Repository navigation
feat: expose canonical heading ID generator for tree transforms - #509
Closed
tubarao312 wants to merge 1 commit into
Closed
tubarao312 wants to merge 1 commit into
tubarao312 wants to merge 1 commit into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Documentation previewsPreviews are disabled for pull requests from forks. |
|
@tubarao312 is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
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.
Expose a per-document heading ID generator from comark/utils, sharing the parser's existing tracker, slug, nesting, authored-ID reservation, and collision rules. Consumers that select or remove AST branches can parse with headingIds:false and allocate IDs only for retained headings without reimplementing CoMark's algorithm.
The helper does not traverse trees or change parser/plugin ordering. Callers control heading provenance and skip raw HTML or literal code. Tests compare results to parser allocation in flat, nested, and disabled modes, including Unicode, authored IDs, collisions, and document isolation.
Validation: 39 focused heading tests, package build, and changed-source lint pass. Combined preview with #508 passes 1,054 core tests and 4 skips, excluding two existing Windows-incompatible suites. Independent thermo-nuclear review approved the helper and downstream traversal, including raw HTML/code provenance, after rerunning the original failing conditional-anchor cases.
Downstream integration: https://github.com/tooling-test/docs/pull/614. It remains gated on an official registry release; the commit-pinned review artifact is https://github.com/tubarao312/comark/releases/tag/brief-reviewed-87bc46e1d9e6. This proposal is independent of the source-range API in #508.