content icon indicating copy to clipboard operation
content copied to clipboard

Syntax highlight breaks

Open Barbapapazes opened this issue 1 year ago • 4 comments

Environment

/

Reproduction

check https://github.com/unjs/website as a reference.

This PR breaks syntax highlight https://github.com/unjs/website/pull/160

Describe the bug

see title

Additional context

No response

Logs

No response

Barbapapazes avatar Jan 30 '24 16:01 Barbapapazes

I think latest deps should have not this issue anymore.

pi0 avatar Feb 07 '24 16:02 pi0

@pi0 I think there are still some issues with highlighting. It doesn't seem to be working. I took this example from the nuxt content website. (Maybe it's not highlighting in this case because of a wrong configuration of the code block -> js [file.js]{4-6,7} meta-info=val but there are only 3 lines. Screenshot 2024-05-30 at 11 30 28 AM

You can notice that lines are not highlighted nor classes are added to the code block.

I also created a repro with the Nuxt documentation template, it does add classes but styling is missing. (I will push this repo a bit later) I added this as the nuxt.config.ts content entry

content: {
    highlight: {
      // Theme used in all color schemes.

      // OR
      theme: {
        // Default theme (same as single string)
        default: 'github-light',
        // Theme used if `html.dark`
        dark: 'github-dark'
      }
    }
  }

Here's the result of the code block, as you can see, the classes are added but css is missing.

Screenshot 2024-05-30 at 10 32 16 AM

Any help would be appreciated on this. p.s. I'm also using latest Shiki 1.6.1

trc-mathieu avatar May 30 '24 15:05 trc-mathieu

@trc-mathieu some classes are missing, I'll make a new issue with proper reproduction. If you need a quick, temporary solution use styles below but please wait for the fix from the authors.

https://gist.github.com/nandordudas/a8487d89e212c9963b0433b3b073e027

nandordudas avatar Jun 11 '24 17:06 nandordudas

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 11 '24 01:08 github-actions[bot]