Comments (6)
Is this a prism thing or do you think it's limited to this plugin?
from eleventy-plugin-syntaxhighlight.
I thought of that. I didn't dive into how the plugin works. I just know that I applied the plugin and multi-line comments were not working. I'm not sure how to isolate the problem to just Prism or the plugin.
My setup for Eleventy was pretty simple. You can see my .eleventy.js
file at my repo here. There I have my own language extension. However, I did try it without and then tried using C code and it still didn't work.
I am injecting Typography.js onto the page but that only affects the CSS, not the Prism parsing.
I did notice though that the Prism version used in the plugin (v1.15.0) is not the latest (v1.16.0). Again, I doubt this is the issue though.
from eleventy-plugin-syntaxhighlight.
Not at a computer currently, can you compare with https://prismjs.com/test.html#language=javascript
What language did you pass in from your content?
from eleventy-plugin-syntaxhighlight.
It must be the plugin. It works on prismjs. I cloned the Eleventy Base Blog and multi line comments don't work there either.
And here is the same input on the base blog. I added the snippet to posts/firstpost.md
from eleventy-plugin-syntaxhighlight.
I wonder if this is related to #9 The new line in the middle of a parsed element is throwing off the parsing.
from eleventy-plugin-syntaxhighlight.
It appears that the highlight line is interfering with multiline elements in the code blocks. markdownSyntaxHighlight.js
PrismJS wraps the whole block in one span including all the line breaks.
<span class="token comment">/*
* block comment
* goes here
*/</span>
I imagine the output should look something like
<span class="line-comment"><span class="token comment">/*</span></span><br>
<span class="line-comment"><span class="token comment"> * block comment </span></span>
...
from eleventy-plugin-syntaxhighlight.
Related Issues (20)
- Added and removed lines get no special styling HOT 1
- Providing a default language for fenced code blocks HOT 8
- Add prismjs alias for `nunjucks` mapped to `jinja2` HOT 2
- Unsupported Languages cause Build Failures HOT 3
- Inline code support HOT 1
- Compatibility with markdown-it-attrs HOT 1
- Upgrade to use Torchlight? HOT 6
- Using the diff function, output is not escaped. HOT 3
- Cannot mix `diff` and `diff-lang` in one app HOT 1
- Feature request: config to add wrapping div HOT 2
- Syntax highlighting can fail if another plugin uses Prism too
- diff-javascript code block generates invalid HTML HOT 1
- Remove character wrap feature.
- Change default `lineSeparator` option to `\n` instead of `<br>` HOT 1
- possibility of adding plugins
- possibility of adding plugins
- possibility of adding Prismjs plugins to a config
- possibility of adding Prismjs plugins to a config
- [Discussion] Allowing users to override Prism instance
- If I'm using Ghost as a data source and it provides article content in HTML code, how can I do code highlighting?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eleventy-plugin-syntaxhighlight.