asciidoctor-reveal.js
asciidoctor-reveal.js copied to clipboard
Code blocks should not have the zenburn background when using pygments / coderay
Right now, when using :source-highlighter: pygments
, the background color of the code blocks will still be the color of the zenburn
background, and not the appropriate one from pygments
.
This might be a reveal.js issue (https://github.com/hakimel/reveal.js/issues/1114), but I haven't quite figured it out.
You are correct that this is an issue with this backend. We need to be checking which syntax highlighter is in use before adding the zenburn style to the HTML output.
Well... I may be over my head, but I'm not sure its quite that simple. I tried just removing the <link href="[...]/zenburn.css">
line from the HTML output, and it still has that same color.
Looking at the Developer Tools > Inspector in Firefox lead me to this:
.reveal pre code {
display: block;
padding: 5px;
overflow: auto;
max-height: 400px;
word-wrap: normal;
background: #3F3F3F;
color: #DCDCDC; }
Which comes from simple.css line 140.
It looks to me like the background
and color
attributes shouldn't be there (i.e., its a problem with reveal.js
), or should be overridden when not using highlight.js
. Overridden might make more sense, as that also covers "plain" code blocks where pygments / coderay wasn't run.
should be overridden when not using highlight.js
Yes, this is the second part to the change. We have to do a lot of this in the default Asciidoctor stylesheet, so it's the same routine here.
Is this still an issue? Can I get a more precise reproducible case with screenshots?