Browse Source

Ignore lists within exporters specific blocks

* lisp/org-exp.el (org-export-mark-list-properties): even if context
  is invalid, mark list item with `list-context' property.
* lisp/org-list.el (org-list-forbidden-blocks): add exporters specific
  blocks to the list of forbidden blocks.

Thanks to Jai Bharat Patel for reporting this.
Nicolas Goaziou 8 years ago
parent
commit
8f0ea16167
2 changed files with 6 additions and 2 deletions
  1. 5 1
      lisp/org-exp.el
  2. 1 1
      lisp/org-list.el

+ 5 - 1
lisp/org-exp.el

@@ -1818,7 +1818,11 @@ These special properties will later be interpreted by the backend."
 	 (lambda (e)
 	   (goto-char (point-min))
 	   (while (re-search-forward (org-item-beginning-re) nil t)
-	     (when (eq (nth 2 (org-list-context)) e) (funcall mark-list e))))
+	     (let ((context (nth 2 (org-list-context))))
+	       (if (eq context e)
+		   (funcall mark-list e)
+		 (put-text-property (point-at-bol) (point-at-eol)
+				    'list-context context)))))
 	 (cons nil org-list-export-context))))))
 
 (defun org-export-attach-captions-and-attributes (target-alist)

+ 1 - 1
lisp/org-list.el

@@ -345,7 +345,7 @@ list, obtained by prompting the user."
 	  (list (symbol :tag "Major mode")
 		(string :tag "Format"))))
 
-(defvar org-list-forbidden-blocks '("example" "verse" "src")
+(defvar org-list-forbidden-blocks '("example" "verse" "src" "latex" "html" "docbook")
   "Names of blocks where lists are not allowed.
 Names must be in lower case.")