GithubHelp home page GithubHelp logo

Comments (6)

zachleat avatar zachleat commented on June 6, 2024

Is this a prism thing or do you think it's limited to this plugin?

from eleventy-plugin-syntaxhighlight.

pianomanfrazier avatar pianomanfrazier commented on June 6, 2024

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.

zachleat avatar zachleat commented on June 6, 2024

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.

pianomanfrazier avatar pianomanfrazier commented on June 6, 2024

It must be the plugin. It works on prismjs. I cloned the Eleventy Base Blog and multi line comments don't work there either.

prism_screenshot

And here is the same input on the base blog. I added the snippet to posts/firstpost.md

base_blog

from eleventy-plugin-syntaxhighlight.

pianomanfrazier avatar pianomanfrazier commented on June 6, 2024

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.

pianomanfrazier avatar pianomanfrazier commented on June 6, 2024

It appears that the highlight line is interfering with multiline elements in the code blocks. markdownSyntaxHighlight.js

highlight-line-bad

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.