summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunyang Xu <mail@xuchunyang.me>2017-11-10 00:28:15 +0800
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-11-12 23:28:57 +0100
commit3f8d67c4904a17a6a0165cc5d2bbe4ee16917f50 (patch)
tree99627e6e4e62ff80db13ebc5313ed82bee89f3d8
parentfcf4bb61ecd6f0471a0a334fdc2178cd9131c964 (diff)
downloadorg-mode-3f8d67c4904a17a6a0165cc5d2bbe4ee16917f50.tar.gz
ox-html: Allow disabling htmlize
* lisp/ox-html.el (org-html-fontify-code): Do it. Disable htmlize by setting org-html-htmlize-output-type to nil. TINYCHANGE
-rw-r--r--lisp/ox-html.el19
1 files changed, 7 insertions, 12 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index fe82099..3073727 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2154,21 +2154,17 @@ CODE is a string representing the source code to colorize. LANG
is the language used for CODE, as a string, or nil."
(when code
(cond
- ;; Case 1: No lang. Possibly an example block.
- ((not lang)
- ;; Simple transcoding.
- (org-html-encode-plain-text code))
- ;; Case 2: No htmlize or an inferior version of htmlize
+ ;; No language. Possibly an example block.
+ ((not lang) (org-html-encode-plain-text code))
+ ;; Plain text explicitly set.
+ ((not org-html-htmlize-output-type) (org-html-encode-plain-text code))
+ ;; No htmlize library or an inferior version of htmlize.
((not (and (or (require 'htmlize nil t)
- (error "Please install htmlize from https://github.com/hniksic/emacs-htmlize"))
+ (error "Please install htmlize from \
+https://github.com/hniksic/emacs-htmlize"))
(fboundp 'htmlize-region-for-paste)))
;; Emit a warning.
(message "Cannot fontify src block (htmlize.el >= 1.34 required)")
- ;; Simple transcoding.
- (org-html-encode-plain-text code))
- ;; Case 3: plain text explicitly set
- ((not org-html-htmlize-output-type)
- ;; Simple transcoding.
(org-html-encode-plain-text code))
(t
;; Map language
@@ -2177,7 +2173,6 @@ is the language used for CODE, as a string, or nil."
(cond
;; Case 1: Language is not associated with any Emacs mode
((not (functionp lang-mode))
- ;; Simple transcoding.
(org-html-encode-plain-text code))
;; Case 2: Default. Fontify code.
(t