Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

yehudab
Copy link
Contributor

@yehudab yehudab commented Oct 14, 2022

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:

  • html - Fixing the original use-case: Generate the same HTML as if the language was recognized, but has no special highlighting (similar to the text language)
  • md - Keep the default markdown processing.

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

@zachleat zachleat merged commit a7afa9b into 11ty:master Apr 12, 2023
@zachleat zachleat added this to the Syntax Highlight v5.0.0 milestone Apr 12, 2023
@zachleat
Copy link
Member

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

@zachleat
Copy link
Member

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants