johannschopplich / kirby-highlighter

🌐 Server-side syntax highlighting for the code block & KirbyText
https://kirbyseo.com
MIT License
20 stars 4 forks source link

Fallback for unknown language types #11

Closed MaluNoPeleke closed 3 years ago

MaluNoPeleke commented 3 years ago

If I set the language type to something unknown (in my case "Plain text", which is the default) for kirby-highlighter (in a block) it returns an error message

Block error: "Unknown language: "text"" in block type: "code"

I would expect instead a fallback to plain code box without specific styling except for dark background and white text.

johannschopplich commented 3 years ago

Good point, should fall back to plain text. Fixed by https://github.com/johannschopplich/kirby-highlighter/commit/45e607b376c27f5ebf90ac65572d79d9092f3ff8.

Could you please re-test with the latest version published?

MaluNoPeleke commented 3 years ago

Thanks, it works with 2.0.1 but I first had to solve a small thing with Composer:

Downloading johannschopplich/kirby-highlighter (v2.0.1)

Could not fetch https://api.github.com/repos/johannschopplich/kirby-highlighter/zipball/45e607b376c27f5ebf90ac65572d79d9092f3ff8, please review your configured GitHub OAuth token or enter a new one to access private repos