You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be honest, I'm not sure if this is an expected behavior, or something unintended. In a recent project, I was using eleventy-plugin-syntaxhighlight to provide straightforward highlighting for markdown files. However, I also created a shortcode for creating previews of code snippets and their processed output. Essentially, what Bootstrap does in their documentation.
For this shortcode, I ended up needing to load my own instance of PrismJS, and the languages I'd need to utilize. Here's a shorthand of what was going on in my config.
In one of my markdown files, I attempted to use eleventy-plugin-syntaxhighlight to style a bash script. What I've discovered is that, by loading PrismJS for use with my shortcode, I inadvertently caused the eleventy-plugin-syntaxhighlight plugin to no longer load the correct languages. I received an error in my console explaining that bash was not an available language for PrismJS.
I ran in circles for a bit before thinking to remove my shortcode and the const prism = require("prismjs"); module. I think the error is occurring either from loading Prism in the config, or by loading const loadLanguages = require("prismjs/components/"); in the config. Even if I removed my shortcode and kept the module imports, the same error would occur. Removing the modules caused the plugin to successfully process the bash highlighting without issue.
Any thoughts on whether or not this is expected, or how to use both functions while maintaining compatibility?
The text was updated successfully, but these errors were encountered:
This is an automated message to let you know that a helpful response was posted to your issue and for the health of the repository issue tracker the issue will be closed. This is to help alleviate issues hanging open waiting for a response from the original poster.
If the response works to solve your problem—great! But if you’re still having problems, do not let the issue’s closing deter you if you have additional questions! Post another comment and we will reopen the issue. Thanks!
Hello, folks.
To be honest, I'm not sure if this is an expected behavior, or something unintended. In a recent project, I was using
eleventy-plugin-syntaxhighlight
to provide straightforward highlighting for markdown files. However, I also created a shortcode for creating previews of code snippets and their processed output. Essentially, what Bootstrap does in their documentation.For this shortcode, I ended up needing to load my own instance of PrismJS, and the languages I'd need to utilize. Here's a shorthand of what was going on in my config.
eleventy.js
In one of my markdown files, I attempted to use
eleventy-plugin-syntaxhighlight
to style abash
script. What I've discovered is that, by loading PrismJS for use with my shortcode, I inadvertently caused theeleventy-plugin-syntaxhighlight
plugin to no longer load the correct languages. I received an error in my console explaining thatbash
was not an available language for PrismJS.I ran in circles for a bit before thinking to remove my shortcode and the
const prism = require("prismjs");
module. I think the error is occurring either from loading Prism in the config, or by loadingconst loadLanguages = require("prismjs/components/");
in the config. Even if I removed my shortcode and kept the module imports, the same error would occur. Removing the modules caused the plugin to successfully process thebash
highlighting without issue.Any thoughts on whether or not this is expected, or how to use both functions while maintaining compatibility?
The text was updated successfully, but these errors were encountered: