Commit 03eacc5
Only relax the indent bound when recompiling list break rules
`_compile_list_break_sc` rewrites the break specs so a list item's own indent
is accepted, by replacing the first literal "3" in each pattern. That assumes
the first "3" is always the leading ` {0,3}` bound. It is, for every rule that
has one -- but a fenced directive's spec has no indent prefix, so its first "3"
is the marker-run quantifier:
^(?P<fenced_directive_mark>(?::){3,})\{[a-zA-Z0-9_-]+\}
Inside a `- ` item that becomes `(?::){1,}`, so a single marker opens a
directive. With `FencedDirective(..., markers=":")`, `:{note}` on its own line
is literal text at the top level and inside a `100. ` item, but inside a `- `
item it is swallowed and an admonition is fabricated:
- item
:{note}
lazy
<ul><li>item</li></ul>
<section class="admonition note">...<p>lazy</p></section>
Anchor the replacement to the ` {0,3}` substring instead. Rules that have an
indent prefix compile identically to before; rules that don't are left alone.
The default markers are unaffected -- they take the `fenced_code` path, which
registers no `fenced_directive` spec.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 060f73a commit 03eacc5
2 files changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| |||
0 commit comments