Skip to content

fix(shiki): handle array class values when highlighting code - #393

Merged
farnabaz merged 2 commits into
comarkdown:mainfrom
dbzx10299:main
Sep 2, 2026
Merged

fix(shiki): handle array class values when highlighting code#393
farnabaz merged 2 commits into
comarkdown:mainfrom
dbzx10299:main

Conversation

@dbzx10299

@dbzx10299 dbzx10299 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

When using Shiki with certain transformers, such as the transformerNotationDiff, child[1].class is an array with this shape:

[ 'line', 'diff', 'remove' ]

If we have a code block:

```ts {1}
const foo = 'foo' // [!code ++]
```

We will have this html output:

<span class="line,diff,add highlight"></span>

Why

@dbzx10299
dbzx10299 requested a review from farnabaz as a code owner September 2, 2026 00:18
@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

comark

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

@comark/angular

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

@comark/ansi

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

@comark/html

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

@comark/nuxt

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

@comark/react

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

@comark/svelte

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

@comark/vue

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

commit: 8337cc9

@farnabaz farnabaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@farnabaz
farnabaz merged commit 647a33d into comarkdown:main Sep 2, 2026
4 of 12 checks passed
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.

2 participants