0

I'm want to export php code snippets to html in org-mode. But as you see signs : '$' and '->' are highlighted by black color which looks terrible. Is it a some kind of error? Btw. is there any themes for highlighting code exported by org-mode?

enter image description here

3
  • 1
    There is a chance that your theme sets the background color, you can investigate it with describe-char.
    – user12563
    Jan 26, 2019 at 11:25
  • I already tried with (fresh start) no config file. Just emacs26.1 and htmlize package. It was the same.
    – slk500
    Jan 26, 2019 at 14:46
  • @DoMiNeLa10 you were right. Once again I started with fresh install and it was the dark theme.
    – slk500
    Jan 26, 2019 at 17:38

1 Answer 1

1

The issue is probably caused by your theme, which sets the background color for these syntaxes. The easiest way to check whether that's the case is to put the point on an offending character in the buffer, and typing M-x describe-char. If the cause turns out to be the background color, it will be listed in face properties. The reason why it's visible in HTML is because Emacs doesn't set the background color of code blocks in HTML export.

You can verify whether the default theme works properly by starting Emacs with no init file (emacs -Q) and loading just the bare minimum (without your theme) to verify that things work properly without it.

3
  • It drives me nuts. I was trying to change it in describe-char menu, but it dosen't work. Those elements: '$' '->' always innherit background from theme. How I can turn it off ?
    – slk500
    Feb 5, 2019 at 20:15
  • You could try looking whether your theme defines background for some syntaxes or something like that.
    – user12563
    Feb 6, 2019 at 17:01
  • Finally with your help I removed that background. As you said @DoMiNeLa10 describe-char then (php-variable-sigil org-block) -> Face: php-variable-sigil (sample) (customize this face) and have to unchecked Inherit from PHP Mode. I was wondering why precise those two signs: '$' and '->' inherit from PHP Mode? Do you think it is some kind of bug? Maybe I should fix this in the PHP Mode package?
    – slk500
    Feb 7, 2019 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.