Skip to content

feat: expose original-source attribute ranges for editors - #508

Closed
tubarao312 wants to merge 2 commits into
comarkdown:mainfrom
tubarao312:feat/source-ranges
Closed

tubarao312 wants to merge 2 commits into
comarkdown:mainfrom
tubarao312:feat/source-ranges

Conversation

@tubarao312

@tubarao312 tubarao312 commented Oct 21, 2026 •

Copy link
Copy Markdown

Add an opt-in comark/source entry point that locates original Markdown link destinations and component attribute values as half-open UTF-16 ranges. Keep offsets separate from the renderable AST and ordinary parsing; disable streaming repair for source analysis. Preserve duplicate/bound attributes and source order so editors can respect effective values.

Reuse the canonical component/attribute grammar and Markdown destination helper. Map LF/CRLF/frontmatter offsets back to original input. Omit references, images, YAML props, raw HTML attributes, malformed values, and transformed source. Escaped-pipe table rows deliberately have no ranges; unmapped groups cannot search backward into literal code.

Independent thermo-nuclear review found and verified fixes for transformed-table false ranges, tab-separated fence offsets, malformed-value endpoints, and quadratic owner lookup. A 16,000-component probe improved from approximately 1,289 ms to 63 ms. No remaining actionable finding was reported.

Validation: 12 source tests and package build/changed-source lint pass. Combined preview with independent heading-generator PR #509 passes 1,054 core tests with 4 skips; two existing Windows-incompatible suites were excluded (CRLF spec fixtures and absolute-path handling). Full verification is also blocked by baseline checkout formatting. External Vercel checks require repository-owner authorization.

Downstream integration: https://github.com/tooling-test/docs/pull/619. Review artifact and provenance: https://github.com/tubarao312/comark/releases/tag/brief-reviewed-87bc46e1d9e6. Draft API proposal; an official registry release is required before downstream publication.

@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@tubarao312 is attempting to deploy a commit to the NuxtLabs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

Documentation previews

Previews are disabled for pull requests from forks.
A maintainer can add the preview:enabled label to enable them.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant