Skip to content

fix(ansi): pre hightlighting issue if line spans are missing - #384

Open
farnabaz wants to merge 3 commits into
mainfrom
fix/ansi-pre-highlighting-missing-line-spans
Open

fix(ansi): pre hightlighting issue if line spans are missing#384
farnabaz wants to merge 3 commits into
mainfrom
fix/ansi-pre-highlighting-missing-line-spans

Conversation

@farnabaz

@farnabaz farnabaz commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix ANSI pre highlighting when Shiki (or similar) emits token spans directly under code without span.line wrappers
  • Accept 3-digit hex colors in addition to 6-digit for --shiki-dark / color styles
  • This will fix rangi highlighting print in terminal

Test plan

  • Render a highlighted fenced code block via @comark/ansi where tokens lack span.line wrappers
  • Confirm token colors still apply when span.line wrappers are present
  • Confirm 3-digit hex colors (e.g. #abc) convert correctly to ANSI truecolor

Handle highlighted code where tokens are direct children of code
instead of nested under span.line, and accept 3-digit hex colors.
@vercel

vercel Bot commented Aug 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
comark Ready Ready Preview Aug 25, 2026 4:00pm
comark-json-render Ready Ready Preview Aug 25, 2026 4:00pm
comark-nextjs Ready Ready Preview Aug 25, 2026 4:00pm
comark-nuxt Ready Ready Preview Aug 25, 2026 4:00pm
comark-svelte Ready Ready Preview Aug 25, 2026 4:00pm
comark-sveltekit Ready Ready Preview Aug 25, 2026 4:00pm
comark-twoslash Ready Ready Preview Aug 25, 2026 4:00pm
comark-vue Ready Ready Preview Aug 25, 2026 4:00pm

@pkg-pr-new

pkg-pr-new Bot commented Aug 24, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

npm i https://pkg.pr.new/comark@384

@comark/angular

npm i https://pkg.pr.new/@comark/angular@384

@comark/ansi

npm i https://pkg.pr.new/@comark/ansi@384

@comark/html

npm i https://pkg.pr.new/@comark/html@384

@comark/nuxt

npm i https://pkg.pr.new/@comark/nuxt@384

@comark/react

npm i https://pkg.pr.new/@comark/react@384

@comark/svelte

npm i https://pkg.pr.new/@comark/svelte@384

@comark/vue

npm i https://pkg.pr.new/@comark/vue@384

commit: 1fdbb61

@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

✅ Bundle snapshot updated

Committed the new snapshot as 1fdbb61, verified by re-running the bundle check against it.

GitHub suppresses the events a workflow commit would normally raise, so the ci check above may
still show the earlier failure. Re-run it to refresh the status — the snapshot itself is confirmed green.

Produced by this run.

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