emacs-htmlize
emacs-htmlize copied to clipboard
Elements of python-mode and highlight-indentation-mode get converted based on theme resulting in ugly colour styles
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-faceandpy-variable-name-facefrompython-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:

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