Repository navigation
fix(parse): keep non-numeric fence braces out of highlights - #643
Conversation
A fence info string such as ```{x} matched the highlight pattern, consumed the brace group, and dropped it because no numeric range was found. Restrict the highlight pattern to digits, commas, dashes, and whitespace so non-numeric braces fall through to `meta` and stay visible in the output.
Add SPEC fixtures for `{1,3-4}` (highlights without a language) and `{x}` (non-numeric braces).
Co-authored-by: Enes Kartal <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Architecture Data flow No data-flow sequence changed in this PR. Review ✨ Nothing flagged · reviewed Tip Set 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
comark
@comark/angular
@comark/ansi
@comark/html
@comark/nuxt
@comark/react
@comark/svelte
@comark/vue
commit: |
Merging this PR will not alter performance1 warning
Comparing |
Summary
0-9,,,-, whitespace) insideparseCodeblockInfo.```{1,3-4}(highlights without a language) and```{x}(non-numeric braces).Behavior
preattributes```{1,3-4}{ highlights: [1, 3, 4] }```{x}{ meta: "{x}" }Previously
{x}matched the highlight pattern, produced no numeric ranges, and the group was consumed and dropped. With the numeric-only pattern it falls through tometa, so the information survives parsing and rendering.Tests
cd packages/comark && pnpm vitest run(2656 passed, 4 skipped)packages/comark/SPEC/COMARK/codeblock-highlight-no-language.md,packages/comark/SPEC/COMARK/codeblock-highlight-invalid.mdCredits
Co-authored-by: @EnesKartal, based on #640.
Summary by CodeRabbit