Commit 6194c5e
authored
fix(lint): don't hide same-stem orphans behind qualified links (#147)
find_orphans added the bare stem of *every* wikilink to the "incoming" set, so
a qualified link like `[[concepts/foo]]` also registered the stem `foo`. Any
other page that merely shared that stem in a different directory (e.g.
`summaries/foo`) was then treated as linked and excluded from orphan
detection — a genuine orphan was silently missed.
Only add the bare stem when the link itself is a bare stem (no `/`); qualified
links register only their full path. Bare `[[foo]]` links still resolve by
stem, so a page named `foo` in any directory remains non-orphaned.
Adds regression tests for both the qualified-link (orphan now flagged) and
bare-link (still matched) cases.1 parent c92f2e9 commit 6194c5e
2 files changed
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 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 | + | |
| 144 | + | |
| 145 | + | |
117 | 146 | | |
118 | 147 | | |
119 | 148 | | |
| |||
0 commit comments