What version of myst-parser are you using?
5.1.0
What version dependencies are you using?
- Sphinx : 9.1.0
- docutils: 0.22.4
What operating system are you using?
Linux
Describe the Bug
It seems that, when using GitHub alerts as admonitions, codefences blocks misbehave.
More specifically, they do not close correctly.
Expected Behavior
Nesting GFM alerts and codefences works as on GitHub and coherently with nesting codefences with other quote blocks (not adminitions).
To Reproduce
Examples
Try rendering the following snippet:
This works:
:::{note}
Tip
```py
"code"
```
other
```py
"other code"
```
:::
but this doesn't
> [!NOTE]
> Note
>
> ```py
> "code"
> ```
>
> other
>
> ```py
> "other code"
> ```
More in general, there is an issue with code fences not closing correctly, e.g.,
> [!NOTE]
> Note
>
> ```py
> code
> ```
For some reason the code fence extends here too, and stops only at the end of the next code fence.
```py
"other code"
```
Now I'm finally outside the code fence!
The issue only seems to affect admonitions, as regular quotes work fine:
> Quote (but not an admonition)
>
> ```py
> "code"
> ```
>
> other
>
> ```py
> "other code"
> ```
and then we are out.
GirHub rendering for reference
This works:
:::{note}
Tip
other
:::
but this doesn't
More in general, there is an issue with code fences not closing correctly, e.g.,
For some reason the code fence extends here too, and stops only at the end of the next code fence.
Now I'm finally outside the code fence!
The issue only seems to affect admonitions, as regular quotes work fine:
Quote (but not an admonition)
other
and then we are out.
What version of
myst-parserare you using?5.1.0
What version dependencies are you using?
What operating system are you using?
Linux
Describe the Bug
It seems that, when using GitHub alerts as admonitions, codefences blocks misbehave.
More specifically, they do not close correctly.
Expected Behavior
Nesting GFM alerts and codefences works as on GitHub and coherently with nesting codefences with other quote blocks (not adminitions).
To Reproduce
Examples
Try rendering the following snippet:
GirHub rendering for reference
This works:
:::{note}
Tip
"code"other
"other code":::
but this doesn't
Note
Note
"code"other
"other code"More in general, there is an issue with code fences not closing correctly, e.g.,
Note
Note
codeFor some reason the code fence extends here too, and stops only at the end of the next code fence.
"other code"Now I'm finally outside the code fence!
The issue only seems to affect admonitions, as regular quotes work fine:
and then we are out.