From c8d1338365cd2964f72ffaef6f8939618d60624e Mon Sep 17 00:00:00 2001 From: Ihor Radchenko Date: Thu, 4 Apr 2024 14:17:27 +0300 Subject: [PATCH] org-html-htmlize-generate-css: Do not omit faces without :inherit property * lisp/ox-html.el (org-html-htmlize-generate-css): Fix not adding faces without :inherit property to the generated css. Update the docstring, detailing that the css class names are the face names with `org-html-htmlize-font-prefix' prepended. --- lisp/ox-html.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index de421ceda..6769028f3 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1828,6 +1828,9 @@ This command just produces a buffer that contains class definitions for all faces used in the current Emacs session. You can copy and paste the ones you need into your CSS file. +The face definitions are prepended with +`org-html-htmlize-font-prefix'. + If you then set `org-html-htmlize-output-type' to `css', calls to the function `org-html-htmlize-region-for-paste' will produce code that uses these same face definitions." @@ -1836,11 +1839,12 @@ produce code that uses these same face definitions." (and (get-buffer "*html*") (kill-buffer "*html*")) (with-temp-buffer (let ((fl (face-list)) - (htmlize-css-name-prefix "org-") + (htmlize-css-name-prefix org-html-htmlize-font-prefix) (htmlize-output-type 'css) f i) - (while (setq f (pop fl) - i (and f (face-attribute f :inherit))) + (while fl + (setq f (pop fl) + i (and f (face-attribute f :inherit))) (when (and (symbolp f) (or (not i) (not (listp i)))) (insert (org-add-props (copy-sequence "1") nil 'face f)))) (htmlize-region (point-min) (point-max))))