From 96115a296c706cbb66e658521d2ce67fa8f52a1b Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 24 Mar 2009 07:19:52 +0100 Subject: [PATCH] HTML export: Allow "- ___" to explicitly terminate a list If a list contains "- ___" as an item, this terminates the list, ignoring this item. --- lisp/ChangeLog | 5 ++++- lisp/org-exp.el | 22 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 137ecaa3a..686d0d21a 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,9 @@ 2009-03-24 Carsten Dominik - * #org-remember.el# (org-remember-backup-directory) + * org-exp.el (org-export-as-html): Close local lists depending on + indentation, also when starting a table. + + * org-remember.el (org-remember-backup-directory) (org-remember-backup-name): New internal variable. 2009-03-23 Carsten Dominik diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 4e36d8fd7..a351f9027 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -3697,6 +3697,7 @@ lang=\"%s\" xml:lang=\"%s\"> (when (not infixed) (setq infixed t) (org-close-par-maybe) + (insert "
\n"))
 	    (insert (org-html-protect (match-string 3 line)) "\n")
 	    (when (or (not lines)
@@ -3998,17 +3999,32 @@ lang=\"%s\" xml:lang=\"%s\">
 	    (org-html-level-start level txt umax
 				  (and org-export-with-toc (<= level umax))
 				  head-count)
+	    
 	    ;; QUOTES
 	    (when (string-match quote-re line)
 	      (org-close-par-maybe)
 	      (insert "
")
 	      (setq inquote t)))
 
+	   ((string-match "^[ \t]*- __+[ \t]*$" line)
+	    ;; Explicit list closure
+	    (when local-list-type
+	      (let ((ind (org-get-indentation line)))
+		(while (and local-list-indent
+			    (<= 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))
+		(or local-list-indent (setq in-local-list nil))))
+	    (throw 'nextline nil))
+
 	   ((and org-export-with-tables
 		 (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
-	    (if (not table-open)
-		;; New table starts
-		(setq table-open t table-buffer nil table-orig-buffer nil))
+	    (when (not table-open)
+	      ;; New table starts
+	      (setq table-open t table-buffer nil table-orig-buffer nil))
+
 	    ;; Accumulate lines
 	    (setq table-buffer (cons line table-buffer)
 		  table-orig-buffer (cons origline table-orig-buffer))
-- 
2.11.4.GIT