fix(docs): preserve heading and anchor fidelity - #16
Merged
Merged
Conversation
matcra587
added this pull request to stack #18
September 21, 2026 23:55
matcra587
marked this pull request as ready for review
September 22, 2026 00:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Heading lookup could miss published anchors or mistake code inside fences for a section. Share source-range heading parsing between extraction and section search, preserve literal source bytes and resolve exact anchors, including duplicate suffixes, inline markup, autolinks and Unicode text. List-contained fences retain their boundaries.
Review Focus
headings.goandextract.go: heading ranges, visible text and exact anchor selection.fence.go: fence characters, lengths and list indentation; focused tests cover false headings and container termination.cursor.go: reject older cursor positions after section-selection semantics change.Test Procedure
mise run ci: formatting, lint, offline race tests, vulnerability checks, release checks and all five compilation targets.FuzzExtractHeadingrun.Pre-flight Checklist
Additional Notes
Cursor format is now v3. Clients holding earlier cursors must restart their original selection. Existing initial calls and byte offsets remain supported. Parsing remains bounded rather than implementing a general Markdown renderer.