diff options
author | Bastien Guerry <bzg@altern.org> | 2013-03-15 15:02:18 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-03-15 15:02:18 +0100 |
commit | e8742b78e0a982a7fca0bf25b4f3551be58660ef (patch) | |
tree | 696e80adfe2febc943bb9cfa1efab24fe15fc211 | |
parent | d660979a0eef4457b861687a46b62c5dd31aec3f (diff) | |
download | org-mode-e8742b78e0a982a7fca0bf25b4f3551be58660ef.tar.gz |
ox-html.el: New option `org-html-indent' to indent the HTML output
* ox-html.el (org-html-indent): New option.
(org-html-use-unicode-chars): New option.
(org-html-pretty-output): Delete.
(org-html-final-function): Use the new options.
-rw-r--r-- | lisp/ox-html.el | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el index c7a9c55..5df9c2a 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -511,8 +511,15 @@ returned as-is." :value-type (string :tag "Format string")) :options '(bold code italic strike-through underline verbatim)) -(defcustom org-html-pretty-output nil - "Enable this to generate pretty HTML." +(defcustom org-html-indent t + "Non-nil means to indent the generated HTML." + :group 'org-export-html + :version "24.4" + :package-version '(Org . "8.0") + :type 'boolean) + +(defcustom org-html-use-unicode-chars nil + "Non-nil means to use unicode characters instead of HTML entities." :group 'org-export-html :version "24.4" :package-version '(Org . "8.0") @@ -3117,14 +3124,16 @@ contextual information." ;;; Filter Functions (defun org-html-final-function (contents backend info) - "Filter to prettify the HTML output. -Prettifying happens if `org-html-pretty-output' is t." - (if (not org-html-pretty-output) contents - (with-temp-buffer - (html-mode) - (insert contents) - (indent-region (point-min) (point-max)) - (buffer-substring-no-properties (point-min) (point-max))))) + "Filter to indent the HTML and convert HTML entities." + (with-temp-buffer + (insert contents) + (set-auto-mode t) + (if org-html-indent + (indent-region (point-min) (point-max))) + (when org-html-use-unicode-chars + (require 'mm-url) + (mm-url-decode-entities)) + (buffer-substring-no-properties (point-min) (point-max)))) ;;; End-user functions |