summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <n.goaziou@gmail.com>2010-08-15 12:39:01 +0200
committerNicolas Goaziou <n.goaziou@gmail.com>2010-09-01 19:05:53 +0200
commit7ef456426e75c333fcabebb40359fde3e47bedee (patch)
tree75b103da7a03bf068bf254fec8bed9f1b39d8bc1
parent1230cf9f097d81d38a6838835bb31495576de030 (diff)
downloadorg-mode-7ef456426e75c333fcabebb40359fde3e47bedee.tar.gz
Fix DocBook and HTML sensitivity about item's body indentation
* org-docbook.el (org-export-as-docbook): Removed check for indentation on lines that do not start with a list bullet. * org-html.el (org-export-as-html): Same thing.
-rw-r--r--lisp/org-docbook.el29
-rw-r--r--lisp/org-html.el21
2 files changed, 20 insertions, 30 deletions
diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el
index d90d949..bca412e 100644
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -1031,22 +1031,6 @@ publishing directory."
(setq item-type "d"
item-tag (match-string 1 line)
line (substring line (match-end 0))))
- (when (and (not (equal item-type "d"))
- (not (string-match "[^ \t]" line)))
- ;; Empty line. Pretend indentation is large.
- (setq ind (1+ (or (car local-list-indent) 1))))
- (while (and in-local-list
- (or (and (= ind (car local-list-indent))
- (not starter))
- (< ind (car local-list-indent))))
- (let ((listtype (car local-list-type)))
- (org-export-docbook-close-li listtype)
- (insert (cond
- ((equal listtype "o") "</orderedlist>\n")
- ((equal listtype "u") "</itemizedlist>\n")
- ((equal listtype "d") "</variablelist>\n"))))
- (pop local-list-type) (pop local-list-indent)
- (setq in-local-list local-list-indent))
(cond
((and starter
(or (not in-local-list)
@@ -1073,8 +1057,19 @@ publishing directory."
(push item-type local-list-type)
(push ind local-list-indent)
(setq in-local-list t))
- (starter
;; Continue current list
+ (starter
+ ;; terminate any previous sublist
+ (while (< ind (car local-list-indent))
+ (let ((listtype (car local-list-type)))
+ (org-export-docbook-close-li listtype)
+ (insert (cond
+ ((equal listtype "o") "</orderedlist>\n")
+ ((equal listtype "u") "</itemizedlist>\n")
+ ((equal listtype "d") "</variablelist>\n"))))
+ (pop local-list-type) (pop local-list-indent)
+ (setq in-local-list local-list-indent))
+ ;; insert new item
(let ((listtype (car local-list-type)))
(org-export-docbook-close-li listtype)
(insert (cond
diff --git a/lisp/org-html.el b/lisp/org-html.el
index 1a5c5eb..ac0a488 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -1555,18 +1555,6 @@ lang=\"%s\" xml:lang=\"%s\">
(setq item-type "d"
item-tag (match-string 1 line)
line (substring line (match-end 0))))
- (when (and (not (equal item-type "d"))
- (not (string-match "[^ \t]" line)))
- ;; empty line. Pretend indentation is large.
- (setq ind (1+ (or (car local-list-indent) 1))))
- (while (and in-local-list
- (or (and (= ind (car local-list-indent))
- (not starter))
- (< ind (car local-list-indent))))
- (org-close-li (car local-list-type))
- (insert (format "</%sl>\n" (car local-list-type)))
- (pop local-list-type) (pop local-list-indent)
- (setq in-local-list local-list-indent))
(cond
((and starter
(or (not in-local-list)
@@ -1583,8 +1571,15 @@ lang=\"%s\" xml:lang=\"%s\">
(push item-type local-list-type)
(push ind local-list-indent)
(setq in-local-list t))
+ ;; Continue list
(starter
- ;; continue current list
+ ;; terminate any previous sublist
+ (while (< ind (car local-list-indent))
+ (org-close-li (car local-list-type))
+ (insert (format "</%sl>\n" (car local-list-type)))
+ (pop local-list-type) (pop local-list-indent)
+ (setq in-local-list local-list-indent))
+ ;; insert new item
(org-close-li (car local-list-type))
(insert (cond
((equal (car local-list-type) "d")