docs(specs): markdown viewer anchor links (GH13725) - #14965
Draft
fbartho wants to merge 2 commits into
Draft
Conversation
Product and tech spec for raw `<a href>`/`<a id>` anchor links and in-document fragment navigation in the Markdown viewer. The viewer already has the click branch, the scroll primitive, and a per-click heading walk; the defect is that find_matching_header compares a fragment against a heading's exact lowercased text, so a hyphenated `#target-section` cannot match a heading reading "Target Section". The spec scopes the fix to a Unicode-preserving slug normalizer applied to both sides of that comparison, plus an `<a href>` inline token reusing the existing Hyperlink::Url styling, explicit anchor targets resolved by the same click-time walk, and cross-document fragment navigation with its three prerequisite resolution repairs. All file:line references verified against master at 495f975.
The spec described the design but not what ships together. Add a delivery-scope section grouping the sixteen invariants into the three slices the work decomposes into, and a matching sequencing note in the tech spec explaining why that order holds (the explicit-target work reuses the heading resolver; cross-document navigation carries the three resolution repairs as prerequisites). Record the visible-literal-anchor-text limitation as current intended behavior rather than a deferred gap: hiding the tag needs a save-round-trippable content-model representation, tracked as warpdotdev#13982.
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.
Closes #13725
Product + technical spec for anchor links in the Markdown viewer: raw
<a href>links, explicit<a id>/<a name>targets, GitHub-style heading slugs, and cross-document fragments (other-file.md#section).ready-to-specflow.<a id="x"></a>renders as text) is documented as current intended behavior, tracked as Markdown viewer: hide own-line<a id>/<a name>anchor tags (currently rendered as literal text) #13982.#13962 remains open as the implementation this spec describes.