summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2011-10-29 15:00:52 +0200
committerBastien Guerry <bzg@altern.org>2011-10-29 15:00:52 +0200
commit97d107d981e060ea6f2584593dc4f4da7ebf1bb9 (patch)
tree0f1e19503392b656de3700bda2a63bbf49589870
parent25bd31ae36a9d7b86867d45444ebe18841ef5d6f (diff)
downloadorg-mode-97d107d981e060ea6f2584593dc4f4da7ebf1bb9.tar.gz
org-html.el (org-html-expand): Return nil if STRING is nil.
* org-html.el (org-html-expand): Prevent a nil value for STRING to return an error, just return nil.
-rw-r--r--lisp/org-html.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 5a08ae4..fa3811f 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -2310,18 +2310,20 @@ Possible conversions are set in `org-export-html-protect-char-alist'."
(defun org-html-expand (string)
"Prepare STRING for HTML export. Apply all active conversions.
-If there are links in the string, don't modify these."
- (let* ((re (concat org-bracket-link-regexp "\\|"
- (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
- m s l res)
- (while (setq m (string-match re string))
- (setq s (substring string 0 m)
- l (match-string 0 string)
- string (substring string (match-end 0)))
- (push (org-html-do-expand s) res)
+If there are links in the string, don't modify these. If STRING
+is nil, return nil."
+ (when string
+ (let* ((re (concat org-bracket-link-regexp "\\|"
+ (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$")))
+ m s l res)
+ (while (setq m (string-match re string))
+ (setq s (substring string 0 m)
+ l (match-string 0 string)
+ string (substring string (match-end 0)))
+ (push (org-html-do-expand s) res)
(push l res))
- (push (org-html-do-expand string) res)
- (apply 'concat (nreverse res))))
+ (push (org-html-do-expand string) res)
+ (apply 'concat (nreverse res)))))
(defun org-html-do-expand (s)
"Apply all active conversions to translate special ASCII to HTML."