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

Unsupported Languages cause Build Failures #70

Closed
Navigatron opened this issue Jul 13, 2022 · 3 comments
Closed

Unsupported Languages cause Build Failures #70

Navigatron opened this issue Jul 13, 2022 · 3 comments
Labels
breaking change This will have to be included with a major version as it breaks backwards compatibility. enhancement New feature or request

Comments

@Navigatron
Copy link

Situation

I have code blocks in my markdown, like the one below:

```sh
echo "Hello!"
```

"sh" is used here purely for the sake of example - I have 400+ pages of content that I'm in the process of migrating, with much more esoterically-tagged code blocks.

Result

Since "sh" is not a valid Prism language, Prism prints a warning. This causes eleventy to stop the build.

[11ty] Problem writing Eleventy templates:
[11ty] 1. Having trouble rendering liquid template ./source/content/xxxxx/xxxxx.md (via TemplateContentRenderError)
[11ty] 2. "sh" is not a valid Prism.js language for eleventy-plugin-syntaxhighlight (via Error)
[11ty] Wrote 0 files in 1.06 seconds (v1.0.1)

Expected Behavior

If a code block uses a language that isn't recognized, I would prefer if that code block were simply not highlighted at all (or treated as plain text) rather than the entire site failing to build.

@yehudab
Copy link
Contributor

yehudab commented Sep 27, 2022

Just to add another use-case:
I want to add eleventy-charts to my blog, and I also useeleventy-plugin-syntaxhighlight.
Since eleventy-charts uses the same triple back-ticks for enclosing chart's data, I can't have both plug-ins running at the same time.

@yehudab
Copy link
Contributor

yehudab commented Oct 14, 2022

See potential fix in PR: #73

@zachleat zachleat added this to the Syntax Highlight v5.0.0 milestone Apr 12, 2023
@zachleat
Copy link
Member

Shipping in 5.0.0, an errorOnInvalidLanguage: false option, the default will be to allow invalid languages—you will have to opt-in to throwing an error.

@zachleat zachleat added enhancement New feature or request breaking change This will have to be included with a major version as it breaks backwards compatibility. labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This will have to be included with a major version as it breaks backwards compatibility. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants