asciidoctor-reveal.js icon indicating copy to clipboard operation
asciidoctor-reveal.js copied to clipboard

Code blocks should not have the zenburn background when using pygments / coderay

Open wackywendell opened this issue 9 years ago • 4 comments

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.

wackywendell avatar May 05 '15 15:05 wackywendell

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.

mojavelinux avatar May 05 '15 20:05 mojavelinux

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.

wackywendell avatar May 05 '15 21:05 wackywendell

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.

mojavelinux avatar May 05 '15 22:05 mojavelinux

Is this still an issue? Can I get a more precise reproducible case with screenshots?

obilodeau avatar Feb 08 '20 04:02 obilodeau