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

Language detection and the File Highlight plugin #607

Closed
trombonehero opened this issue Jun 24, 2015 · 4 comments
Closed

Language detection and the File Highlight plugin #607

trombonehero opened this issue Jun 24, 2015 · 4 comments

Comments

@trombonehero
Copy link

Thanks very much for Prism: it looks like it might be exactly what I need for including external code snippets on assignment pages for a course I'm teaching. Except for this one issue. :)

When I try to fetch a C++ header file, I use something like this:

<pre class="language-cpp" data-src="some-header.h"/>

After the File Highlight plugin runs, however, what I see in my Web Inspector is:

<pre class="language-cpp data-src="some-header.h"
    <code class="language-h">
        "/* ... */"
    </code>
</pre>

So, it looks like the language that I've specified on the pre isn't getting propagated to the dynamically-generated code element within it.

@trombonehero
Copy link
Author

Maybe somewhere around plugins/file-highlight/prism-file-highlight.js:24 the plugin should check "if my pre has a class that includes language-, let me copy that rather than using the extension"?

@Golmote
Copy link
Contributor

Golmote commented Jun 25, 2015

Yes, I totally agree with you. I'll see if I can make the change.

@trombonehero
Copy link
Author

The new version works perfectly. Thank you!

@Golmote
Copy link
Contributor

Golmote commented Jun 25, 2015

Thank you for reporting!

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

No branches or pull requests

2 participants