atom-community / markdown-preview-plus

Markdown Preview + Community Features
https://atom.io/packages/markdown-preview-plus
Other
370 stars 85 forks source link

Code block syntax highlighting incorrectly #511

Closed RadioheadFonts closed 4 years ago

RadioheadFonts commented 4 years ago

Sometimes (in confusing circumstances) the syntax highlighting for a code block inside the preview gets the colours wrong, but plain markdown-preview renders them correctly.

The problem occurs regardless of whether I am using the pandoc or markdown-it backend.

I have noticed that this happens in several different grammars, but in this particular example, I am using the language-riscv package. Here is the source markdown:

```riscv
add   s0, a0, t0      #comment (not right)
lw    s2 8(s0)        #comment (renders correctly)
bgeu  s3, s2, 3       #comment (rest of line not right either)
```

The result in markdown-preview: mp

And the result in markdown-preview-plus: mpp

lierdakil commented 4 years ago

Okay, a quick fix: use legacy highlighter image meanwhile I'll try to figure out what breaks.

lierdakil commented 4 years ago

Should be fixed in v4.8.3. Thanks for reporting!