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

  • 1
    There is a chance that your theme sets the background color, you can investigate it with describe-char. – DoMiNeLa10 Jan 26 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 at 14:46
  • @DoMiNeLa10 you were right. Once again I started with fresh install and it was the dark theme. – slk500 Jan 26 at 17:38
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.

  • 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 at 20:15
  • You could try looking whether your theme defines background for some syntaxes or something like that. – DoMiNeLa10 Feb 6 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 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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