11ty / eleventy-plugin-syntaxhighlight

A pack of Eleventy plugins for syntax highlighting in Markdown, Liquid, and Nunjucks templates.
https://www.11ty.dev/docs/plugins/syntaxhighlight/
MIT License
129 stars 32 forks source link

Add an option to ignore invalid languages. Fixes #70 #73

Closed yehudab closed 1 year ago

yehudab commented 2 years ago

In order to support both use-cases described in the issue, I've added an option called: ignoreInvalidLanguages. This option can take take one of two values:

The difference in the output between the two options can also be seen in the newly added tests.

zachleat commented 1 year ago

This will get a bit of post-merge tweaking but thank you!!

zachleat commented 1 year ago

This resulted in an errorOnInvalidLanguage: false option, we’re going to change the default behavior to not throw an error in v5.0.0—thank you!