Commit 2bfaf1d
committed
issue-379: only treat standalone ``` lines as code fences
The previous heuristic `line.lstrip().startswith("```")` matched escaped
inline-code constructs such as `` ``` `code-span` `` `` (used in
req/README.md to document forbidden anchor formatting), causing the
fence state machine to flip mid-file and silently skip the rest of the
document from link validation.
Replace with `FENCE_LINE_RE = ^\s*```[A-Za-z0-9_-]*\s*$` so that only
lines consisting solely of a fence (with optional language identifier)
toggle fence state. Verified by injecting a deliberately broken link at
the end of req/README.md and confirming the validator now flags it.1 parent 99e3c9e commit 2bfaf1d
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
345 | 350 | | |
346 | 351 | | |
347 | 352 | | |
| |||
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
355 | | - | |
356 | | - | |
| 360 | + | |
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
| |||
0 commit comments