Explorar el Código

Export: Fix bug with exporting text before first heading

Skipping text before the first heading was broken, now it works again.
Carsten Dominik hace 17 años
padre
commit
477141d43c
Se han modificado 2 ficheros con 4 adiciones y 1 borrados
  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")))