EldoranDev / gridsome-plugin-remark-shiki

Syntax highlighter for markdown code blocks using shiki
15 stars 8 forks source link

unknown language fallback not formatting correctly #21

Closed scrambldchannel closed 3 years ago

scrambldchannel commented 3 years ago

Hi

I'm finding that fenced code blocks without a language specified, or with an unknown language specified, aren't being formatted correctly.

Eg

601,100
602,"}bedrock.cube.rule.processfeeders"

Produces this in gridsome:

601,100 602,"}bedrock.cube.rule.processfeeders"

When I would expect something like:

601,100
602,"}bedrock.cube.rule.processfeeders"

It's a bit hard to read with github doing its own formatting but essentially the fallback for unknown languages doesn't include the <pre> tag. I'll create a simple PR to illustrate.

I actually came across this because I was trying to use text as the language which shiki added support for https://github.com/shikijs/shiki/commit/d507a22403efb7c429b94ae12f6b63673cdc8e8a but this doesn't work either but I think that's down to the way shiki has implemented it such text, txt and plaintext don't get added to shiki-languages. Fixing the unknown language fallback would allow me to work around it.

Cheers Alex