hniksic / emacs-htmlize

Convert buffer text and decorations to HTML.
193 stars 44 forks source link

option to ignore background color #45

Open VladimirAlexiev opened 1 year ago

VladimirAlexiev commented 1 year ago

My emacs buffer looks like this: image

I grab it using ox-clip and paste it to google docs, and it looks ugly: image

After I remove extra line spacing in gdocs, it looks a bit better: image

But still the best way is to have an option to ignore the background color. I think the right function to change is: https://github.com/hniksic/emacs-htmlize/blob/master/htmlize.el#L947

VladimirAlexiev commented 1 year ago

I currently do it with defadvice

(setq-default  htmlize-ignore-background t)           ; ignore background color
(use-package htmlize
  :config
  (defadvice htmlize-face-background (around htmlize-ignore-background activate)
    "Ignore background if htmlize-ignore-background is set"
    (unless htmlize-ignore-background ad-do-it)))