Browse Source

Export: Fix bug with exporting text before first heading

Skipping text before the first heading was broken, now it works again.
Carsten Dominik 17 năm trước cách đây
mục cha
commit
477141d43c
2 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-02-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-preprocess-string): Fix bug when skipping
+	text before first headline.
+
 	* org.el (org-format-latex): Do not convert LaTeX fragments in
 	protected examples.
 

+ 1 - 1
lisp/org-exp.el

@@ -1538,7 +1538,7 @@ on this string to produce the exported version."
       ;; Get the correct stuff before the first headline
       (when (plist-get parameters :skip-before-1st-heading)
 	(goto-char (point-min))
-	(when (re-search-forward "\\(^#.*\n\\)^\\*+[ \t]" nil t)
+	(when (re-search-forward "^\\(#.*\n\\)?\\*+[ \t]" nil t)
 	  (delete-region (point-min) (match-beginning 0))
 	  (goto-char (point-min))
 	  (insert "\n")))