Casper and highlight.js

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.

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

Yep.

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

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

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?

Yep, will do that. Thanks.

I think that’s the only way.

Seems like you would need to edit the css then.

1 Like

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