Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation does not render lists inside of [info] tags correctly #280

Closed
cotpat opened this issue Nov 28, 2023 · 2 comments
Closed

Documentation does not render lists inside of [info] tags correctly #280

cotpat opened this issue Nov 28, 2023 · 2 comments
Labels

Comments

@cotpat
Copy link

cotpat commented Nov 28, 2023

Lists seem to break detection of at least the closing [/info] tag. This may or may not be related to the lack of a newline after the last list item. Due to the closing tag not being detected correctly, subsequent tags (such as [notice]) will not render correctly either. This persists until the next [/info] tag is encountered.

The issue is visible e.g. on the doc page for templating, just underneath the linked header (starting with the Foo example list).

Source code for that, in case that page gets updated:

[info]
Arguments passed into methods can be any non-array literal type (not just strings), e.g:

- `$Foo(1)` will pass `1` as an int
- `$Foo(0.5)` will pass `0.5` as a float
- `$Foo(true)` will pass `true` as a boolean
- `$Foo(null)` will pass `null` as a null primitive
- `$Foo("param")`, `$Foo('param')`, and `$Foo(param)` will all pass `'param'` as a string. It is recommended that you always use quotes when passing a string for clarity
[/info]
@GuySartorelli GuySartorelli transferred this issue from silverstripe/developer-docs Nov 30, 2023
@GuySartorelli
Copy link
Member

This happens because the [/info] closing tag is technically inside the list, so the regex in https://github.com/silverstripe/doc.silverstripe.org/blob/master/src/utils/cleanCalloutTags.ts doesn't capture it correctly.

We might have to start doing something a little more sophisticated here. silverstripe/developer-docs#388 has some suggestions we might want to look into.

We could alternatively just implement silverstripe/developer-docs#388 and have part of the linting rules be that there's an empty linebreak before the closing tag - in that case we wouldn't need to fix the actual bug.

@emteknetnz
Copy link
Member

Duplicate of #282

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants