Commit 5aac2d8
committed
fix(tostring): add footnote pattern to LPeg parser for correct table column widths
The tostring module (used for table column width calculation) had no
pattern for footnote references like [^1] or [^label]. These were
falling through to hyperlink_no_src, which strips [ and ] but keeps
the ^ character, producing a width 1 character too wide.
Add a dedicated footnote LPeg pattern that:
- Matches [^label] syntax (placed before hyperlink in token priority)
- Strips [^ and ] delimiters (matching actual renderer behavior)
- Looks up footnote config for icon/corner/padding decorations
- Returns the correct visual string for width measurement
This fixes misaligned table columns for rows containing footnote
references.1 parent ed989a2 commit 5aac2d8
1 file changed
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
308 | 349 | | |
309 | 350 | | |
310 | 351 | | |
| |||
629 | 670 | | |
630 | 671 | | |
631 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
632 | 676 | | |
633 | 677 | | |
634 | 678 | | |
| |||
678 | 722 | | |
679 | 723 | | |
680 | 724 | | |
681 | | - | |
| 725 | + | |
682 | 726 | | |
683 | 727 | | |
684 | 728 | | |
| |||
0 commit comments