Browse Source

Remove extra newline after transformed code examples

Carsten Dominik 15 years ago
parent
commit
3bc637a2a1
2 changed files with 4 additions and 1 deletions
  1. 3 0
      lisp/ChangeLog
  2. 1 1
      lisp/org-exp.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-12-09  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-exp.el (org-export-replace-src-segments-and-examples): Also
+	take the final newline after the END line.
+
 	* org.el (org-clean-visibility-after-subtree-move): Only fix
 	entries that are not entirely invisible already.
 	(org-insert-link): Respect org-link-file-path-type for

+ 1 - 1
lisp/org-exp.el

@@ -2266,7 +2266,7 @@ in the list) and remove property and value from the list in LISTVAR."
 	lang code trans opts indent)
     (goto-char (point-min))
     (while (re-search-forward
-	    "\\(^\\([ \t]*\\)#\\+BEGIN_SRC:?[ \t]+\\([^ \t\n]+\\)\\(.*\\)\n\\([^\000]+?\n\\)[ \t]*#\\+END_SRC.*\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\\)"
+	    "\\(^\\([ \t]*\\)#\\+BEGIN_SRC:?[ \t]+\\([^ \t\n]+\\)\\(.*\\)\n\\([^\000]+?\n\\)[ \t]*#\\+END_SRC.*\n?\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\n?\\)"
 	    nil t)
       (if (match-end 1)
 	  ;; src segments