Skip to content

Roles in arguments are not properly parsed #29

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

Open
rowanc1 opened this issue Feb 14, 2022 · 5 comments
Open

Roles in arguments are not properly parsed #29

rowanc1 opened this issue Feb 14, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@rowanc1
Copy link
Member

rowanc1 commented Feb 14, 2022

Leaving this as an issue here to look into in a bit. @chrisjsewell if you have ideas in that part of the code base as to why I would love to hear them!

For example, this does not parse in an admonition.

```{admonition} A **bold**{sup}`2` admonition *title*
Here is an admonition!
```
@rowanc1
Copy link
Member Author

rowanc1 commented Feb 24, 2022

I think this may actually be any ` in the admonition title.

@rowanc1
Copy link
Member Author

rowanc1 commented Feb 25, 2022

This does work in sphinx, so I think we should support it!

This:
image

Becomes:
image

@rowanc1
Copy link
Member Author

rowanc1 commented Mar 21, 2022

@chrisjsewell do you have some guidance on this? It looks like the "fence" pass does not pick these up if there is a ` in the argument area of a directive. Both a problem in python/js implementations.

@rowanc1 rowanc1 added the bug Something isn't working label Mar 21, 2022
@fwkoch
Copy link
Member

fwkoch commented Mar 23, 2022

This restriction goes all the way back to fence parsing in markdown-it and commonmark - https://github.com/markdown-it/markdown-it/blob/df4607f1d4d4be7fdc32e71c04109aea8cc373fa/lib/rules_block/fence.js#L34-L38

This isn't a problem if tildes are used for the fence, e.g.

~~~{admonition} A **bold**{sup}`2` admonition *title*
Here is an admonition!
~~~

So we could constrain the MyST spec to just using those for directives.

Somehow changing the fence parsing logic is also possible, but that would be a deep change with significant implications...

@rowanc1
Copy link
Member Author

rowanc1 commented Sep 20, 2022

The other alternative now exposed is to use colon fences, which don't fight as hard with some auto-formatting rules!

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants