diff --git a/lisp/org-docbook.el b/lisp/org-docbook.el index d90d949c8..bca412e6e 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") "\n") - ((equal listtype "u") "\n") - ((equal listtype "d") "\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") "\n") + ((equal listtype "u") "\n") + ((equal listtype "d") "\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 1a5c5eb9b..ac0a48809 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 "\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 "\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")