summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2011-01-04 22:10:25 +0100
committerNicolas Goaziou <n.goaziou@gmail.com>2011-02-18 12:45:09 +0100
commit2621fe04619c7ca446b1c2d6821907c8f332972e (patch)
tree4872898787691294cbb3ec6696c2ab2f4704b374
parentc32e39786dcc5e42d49a0195a2b91da3d7733e08 (diff)
downloadorg-mode-2621fe04619c7ca446b1c2d6821907c8f332972e.tar.gz
Do not remove empty list items in HTML and DocBook export
-rw-r--r--lisp/org-docbook.el10
-rw-r--r--lisp/org-html.el14
2 files changed, 8 insertions, 16 deletions
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index ac3d7f1..740a68c 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -1041,20 +1041,12 @@ publishing directory."
(if (eq major-mode (default-value 'major-mode))
(nxml-mode)))
- ;; Remove empty paragraphs and lists. Replace them with a
- ;; newline.
+ ;; Remove empty paragraphs. Replace them with a newline.
(goto-char (point-min))
(while (re-search-forward
"[ \r\n\t]*\\(<para>\\)[ \r\n\t]*</para>[ \r\n\t]*" nil t)
(when (not (get-text-property (match-beginning 1) 'org-protected))
(replace-match "\n")
- ;; Avoid empty <listitem></listitem> caused by inline tasks.
- ;; We should add an empty para to make everything valid.
- (when (and (looking-at "</listitem>")
- (save-excursion
- (backward-char (length "<listitem>\n"))
- (looking-at "<listitem>")))
- (insert "<para></para>"))
(backward-char 1)))
;; Fill empty sections with <para></para>. This is to make sure
;; that the DocBook document generated is valid and well-formed.
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 7ed3f2a..a7199e2 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1719,16 +1719,16 @@ lang=\"%s\" xml:lang=\"%s\">
(goto-char (match-end 0))
(insert "\n")))
(insert "<div id=\"table-of-contents\">\n")
- (mapc 'insert thetoc)
- (insert "</div>\n"))
- ;; remove empty paragraphs and lists
+ (let ((beg (point)))
+ (mapc 'insert thetoc)
+ (insert "</div>\n")
+ (while (re-search-backward "<li>[ \r\n\t]*</li>\n?" beg t)
+ (replace-match ""))))
+ ;; remove empty paragraphs
(goto-char (point-min))
(while (re-search-forward "<p>[ \r\n\t]*</p>" nil t)
(replace-match ""))
(goto-char (point-min))
- (while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
- (replace-match ""))
- (goto-char (point-min))
;; Convert whitespace place holders
(goto-char (point-min))
(let (beg end n)
@@ -2440,7 +2440,7 @@ the alist of previous items."
(let* ((counter (match-string 2 line))
(checkbox (match-string 3 line))
(desc-tag (or (match-string 4 line) "???"))
- (body (match-string 5 line))
+ (body (or (match-string 5 line) ""))
(list-beg (org-list-get-list-begin pos struct prevs))
(firstp (= list-beg pos))
;; Always refer to first item to determine list type, in