Skip to content

Commit 6a6db67

Browse files
committed
fix: reference crossfilereferenceintegrity helpers by name, not line
Line numbers drift as the file evolves. Replace 'around lines 349 and 389' with a reference to the collectHeadingAnchors / slugify helpers.
1 parent e5f95ea commit 6a6db67

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

plan/89_toc-generator-directive.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,15 @@ heading anchor mdsmith already computes for
9090
cross-file heading references.
9191

9292
Do not define a TOC-specific slug algorithm.
93-
Reuse the `slugify` function and
94-
duplicate-disambiguation logic currently in
93+
Reuse the `slugify` function and the
94+
duplicate-disambiguation logic in
9595
[`internal/rules/crossfilereferenceintegrity/rule.go`][cfri]
96-
(around lines 349 and 389). Move that helper
97-
into a shared package — `internal/mdtext/` is
98-
the natural home — and have both rules call
99-
the shared code so anchors stay consistent
100-
across rules. Repeated headings must receive
101-
the same `-1`, `-2`, … suffixes in source
102-
order as the existing reference-integrity
103-
rule.
96+
(used by `collectHeadingAnchors`). Move it
97+
into a shared package. `internal/mdtext/` is
98+
the natural home. Both rules then call shared
99+
code so anchors stay consistent. Repeated
100+
headings get `-1`, `-2`, … suffixes in source
101+
order, matching the reference-integrity rule.
104102

105103
[cfri]: ../internal/rules/crossfilereferenceintegrity/rule.go
106104

0 commit comments

Comments
 (0)