diff options
author | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-12-22 09:54:14 +0100 |
---|---|---|
committer | Nicolas Goaziou <n.goaziou@gmail.com> | 2010-12-22 09:54:14 +0100 |
commit | 478eabccbdefbf8e2c7d9284267335c84ad6adb5 (patch) | |
tree | 8f2ca012802268e31cb9933567801da9ee780c51 | |
parent | 1d3db31ca75d7396dd374199cb4188ffe081a944 (diff) | |
download | org-mode-478eabccbdefbf8e2c7d9284267335c84ad6adb5.tar.gz |
org-exp: ensure list ending marker is inserted on a line on its own
* lisp/org-exp.el (org-export-mark-list-ending): insert additional
newline characters if end-list-marker is at a wrong position.
This solves a problem arising when exporting a region to HTML with a
list ending at the end of region. The marker would then be inserted on
the last line, following text from the list.
-rw-r--r-- | lisp/org-exp.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 32a5f86..9dca4f5 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1669,7 +1669,10 @@ These special cookies will later be interpreted by the backend. (when (and (not (eq org-list-ending-method 'indent)) (looking-at (org-list-end-re))) (replace-match "\n")) - (insert end-list-marker))))) + (unless (bolp) (insert "\n")) + (unless (looking-at end-list-marker) + (insert end-list-marker)) + (unless (eolp) (insert "\n")))))) ;; We need to divide backends into 3 categories. (cond ;; 1. Backends using `org-list-parse-list' do not need markers. |