Commit 725c8af
committed
fix(noreferencestyle): return nil when all footnote matches are filtered out
The round-2 fix only guarded the zero-regex-match case. When
FindAllSubmatchIndex finds matches but every one is filtered out by
isFootnoteDefinitionAt/codeLines/codeSpans (e.g. a footnote-shaped
token entirely inside a code span or code block), the pre-sized
out stayed a non-nil empty slice instead of nil. Move the nil check
to after the filter loop (len(out) == 0) instead of before it
(len(matches) == 0), covering both cases with one guard. Caught
independently by two round-3 review angles.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BTLNzEVChZtqSc7m7ph5Ah1 parent ed2c65a commit 725c8af
2 files changed
Lines changed: 33 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | 376 | | |
380 | 377 | | |
381 | 378 | | |
| |||
398 | 395 | | |
399 | 396 | | |
400 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | 409 | | |
413 | 410 | | |
414 | 411 | | |
| |||
424 | 421 | | |
425 | 422 | | |
426 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| |||
0 commit comments