Просмотр исходного кода

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 13 лет назад
Родитель
Сommit
8f0ea16167
2 измененных файлов с 6 добавлено и 2 удалено
  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)
 	 (lambda (e)
 	   (goto-char (point-min))
 	   (goto-char (point-min))
 	   (while (re-search-forward (org-item-beginning-re) nil t)
 	   (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))))))
 	 (cons nil org-list-export-context))))))
 
 
 (defun org-export-attach-captions-and-attributes (target-alist)
 (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")
 	  (list (symbol :tag "Major mode")
 		(string :tag "Format"))))
 		(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 of blocks where lists are not allowed.
 Names must be in lower case.")
 Names must be in lower case.")