Skip to content

Commit 87b10c5

Browse files
🧪 Add regression test for code fences inside GFM alert blocks (#1142)
Code fences weren't closing properly when nested inside GFM alert quote blocks (`> [!NOTE]`), causing content to leak outside the alert. The fix is already present in `markdown-it-py 4.2.0` (the minimum version required by this project). This PR adds a regression test to prevent future breakage. - Added `[alert-code-fence]` fixture covering multiple fenced code blocks inside an alert ```markdown > [!NOTE] > Note > > ```py > "code" > ``` > > other > > ```py > "other code" > ``` ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chrisjsewell <2997570+chrisjsewell@users.noreply.github.com> Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
1 parent 80248d4 commit 87b10c5

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

tests/test_renderers/fixtures/docutil_syntax_extensions.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,35 @@ content
255255
Second paragraph.
256256
.
257257

258+
[alert-code-fence] --myst-enable-extensions=alert
259+
.
260+
> [!NOTE]
261+
> Note
262+
>
263+
> ```py
264+
> "code"
265+
> ```
266+
>
267+
> other
268+
>
269+
> ```py
270+
> "other code"
271+
> ```
272+
.
273+
<document source="<string>">
274+
<note>
275+
<paragraph>
276+
Note
277+
<literal_block classes="code py" xml:space="preserve">
278+
<inline classes="s2">
279+
"code"
280+
<paragraph>
281+
other
282+
<literal_block classes="code py" xml:space="preserve">
283+
<inline classes="s2">
284+
"other code"
285+
.
286+
258287
[gfm_autolink] --myst-enable-extensions=gfm_autolink
259288
.
260289
Visit www.example.com for info.

0 commit comments

Comments
 (0)