Casper and highlight.js


#1

Hi,

I have been trying to get highlight.js to work with casper. Here is the code:

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/dracula.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/cpp.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/x86asm.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

It seems that:

.post-full-content pre code * {
    color: inherit;
}

In line 936 of screen.css is removing the syntax highlighting.

Is there any way to remove this without editing the file directly (i.e. code injection).

Thanks.


#2

I had the hack the CSS to make it work. I don’t think you can not change this.


#3

Yep.

You could try prism.js? Got it to work with just the easy code injects in the new Ghost 2.x


#4

Sadly there is no support in prism.js for x86-assembly :frowning:


#5

Oh man, sorry about that. Didn’t recognize you needed x86 assembly. Now I see it.

Seems like you would need to edit the css then. Maybe download the theme you’re using, edit the css and upload as new theme? At least that way you don’t have to style inline and stuff like that?


#6

Yep, will do that. Thanks.


#7

I think that’s the only way.

Seems like you would need to edit the css then.


#8

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.