emacs-htmlize icon indicating copy to clipboard operation
emacs-htmlize copied to clipboard

Elements of python-mode and highlight-indentation-mode get converted based on theme resulting in ugly colour styles

Open aseltmann opened this issue 5 years ago • 0 comments

I noticed when exporting org-mode buffers to html that some characters got rendered in an undesired way:

  • Variables and Numbers in Python blocks: This issue on StackOverflow has a good screenshot showing the problem and also found the culprits: the variables py-number-face and py-variable-name-face from python-mode.el, which get an own <span> container when htmlized, and from me trying to tinker around I found that the background colour for this container is taken from the current Emacs theme's background colour of the respective characters.
  • These highlights - I think they come from highlight-indentation.el @antonj (see here). I have not tracked down the variable which is picked up here yet, but I examined it with some browser developer tools and it looks exactly like the issue above - these characters get a <span> container and the background colour of the Emacs theme. I made a screenshot:

Screenshot_20200512_210016

As described in the SO issue regarding the python-mode.el variables, there is a workaround in setting them to nil like this:

(setq py-number-face nil)
(setq py-variable-name-face nil)

But I think this is a quite dirty fix. Also, I could not yet fix the highlight-indentation problem (deactivating the minor mode didn't help).

Version information:
  • Emacs: 26.3
  • org: 9.3.6
  • htmlize: release/1.55-2-g86f22f2
  • python-mode: 6.2.3-284-g9c33629
  • highlight-indentation: v0.7.0-16-gd03803f

aseltmann avatar May 12 '20 19:05 aseltmann