Do not try to guess list ending and let org-list.el do its job.
* lisp/org-html.el: preprocess buffer string and add ORG-LIST-END where needed. Lists should not end before seeing this.
This commit is contained in:
parent
6167dfa444
commit
1d99d9ee73
|
@ -1185,7 +1185,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(org-open-par))
|
||||
(throw 'nextline nil))
|
||||
|
||||
(org-export-html-close-lists-maybe line)
|
||||
;; (org-export-html-close-lists-maybe line)
|
||||
|
||||
;; Protected HTML
|
||||
(when (get-text-property 0 'org-protected line)
|
||||
|
@ -1490,14 +1490,14 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(setq txt (replace-match "" t t txt)))
|
||||
(if (<= level (max umax umax-toc))
|
||||
(setq head-count (+ head-count 1)))
|
||||
;; (when in-local-list
|
||||
;; ;; Close any local lists before inserting a new header line
|
||||
;; (while local-list-type
|
||||
;; (org-close-li (car local-list-type))
|
||||
;; (insert (format "</%sl>\n" (car local-list-type)))
|
||||
;; (pop local-list-type))
|
||||
;; (setq local-list-indent nil
|
||||
;; in-local-list nil))
|
||||
(when in-local-list
|
||||
;; Close any local lists before inserting a new header line
|
||||
(while local-list-type
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (format "</%sl>\n" (car local-list-type)))
|
||||
(pop local-list-type))
|
||||
(setq local-list-indent nil
|
||||
in-local-list nil))
|
||||
(setq first-heading-pos (or first-heading-pos (point)))
|
||||
(org-html-level-start level txt umax
|
||||
(and org-export-with-toc (<= level umax))
|
||||
|
@ -1509,7 +1509,7 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(insert "<pre>")
|
||||
(setq inquote t)))
|
||||
|
||||
((string-match "^ORG-LIST-END$" line)
|
||||
((string-match "^ORG-LIST-END" line)
|
||||
;; Explicit list closure
|
||||
(let ((ind (org-get-indentation line)))
|
||||
(while (and local-list-indent
|
||||
|
@ -1667,14 +1667,14 @@ lang=\"%s\" xml:lang=\"%s\">
|
|||
(when inquote
|
||||
(insert "</pre>\n")
|
||||
(org-open-par))
|
||||
(when in-local-list
|
||||
;; Close any local lists before inserting a new header line
|
||||
(while local-list-type
|
||||
(org-close-li (car local-list-type))
|
||||
(insert (format "</%sl>\n" (car local-list-type)))
|
||||
(pop local-list-type))
|
||||
(setq local-list-indent nil
|
||||
in-local-list nil))
|
||||
;; (when in-local-list
|
||||
;; ;; Close any local lists before inserting a new header line
|
||||
;; (while local-list-type
|
||||
;; (org-close-li (car local-list-type))
|
||||
;; (insert (format "</%sl>\n" (car local-list-type)))
|
||||
;; (pop local-list-type))
|
||||
;; (setq local-list-indent nil
|
||||
;; in-local-list nil))
|
||||
(org-html-level-start 1 nil umax
|
||||
(and org-export-with-toc (<= level umax))
|
||||
head-count)
|
||||
|
@ -2277,28 +2277,28 @@ If there are links in the string, don't modify these."
|
|||
(defvar in-local-list)
|
||||
(defvar local-list-indent)
|
||||
(defvar local-list-type)
|
||||
(defun org-export-html-close-lists-maybe (line)
|
||||
"Close local lists based on the original indentation of the line."
|
||||
(let* ((rawhtml (and in-local-list
|
||||
(get-text-property 0 'org-protected line)
|
||||
(not (get-text-property 0 'org-example line))))
|
||||
;; rawhtml means: This was between #+begin_html..#+end_html
|
||||
;; originally, thus it excludes stuff that was a source code example
|
||||
;; Actually, this code seems wrong, I don't know why it works, but
|
||||
;; it seems to work.... So keep it like this for now.
|
||||
(ind (if rawhtml
|
||||
(org-get-indentation line)
|
||||
(get-text-property 0 'original-indentation line)))
|
||||
didclose)
|
||||
(when ind
|
||||
(while (and in-local-list
|
||||
(<= ind (car local-list-indent)))
|
||||
(setq didclose t)
|
||||
(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))
|
||||
(and didclose (org-open-par)))))
|
||||
;; (defun org-export-html-close-lists-maybe (line)
|
||||
;; "Close local lists based on the original indentation of the line."
|
||||
;; (let* ((rawhtml (and in-local-list
|
||||
;; (get-text-property 0 'org-protected line)
|
||||
;; (not (get-text-property 0 'org-example line))))
|
||||
;; ;; rawhtml means: This was between #+begin_html..#+end_html
|
||||
;; ;; originally, thus it excludes stuff that was a source code example
|
||||
;; ;; Actually, this code seems wrong, I don't know why it works, but
|
||||
;; ;; it seems to work.... So keep it like this for now.
|
||||
;; (ind (if rawhtml
|
||||
;; (org-get-indentation line)
|
||||
;; (get-text-property 0 'original-indentation line)))
|
||||
;; didclose)
|
||||
;; (when ind
|
||||
;; (while (and in-local-list
|
||||
;; (<= ind (car local-list-indent)))
|
||||
;; (setq didclose t)
|
||||
;; (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))
|
||||
;; (and didclose (org-open-par)))))
|
||||
|
||||
(defvar body-only) ; dynamically scoped into this.
|
||||
(defun org-html-level-start (level title umax with-toc head-count)
|
||||
|
|
Loading…
Reference in New Issue