浏览代码

Fix problem with <pre> of source code inside a paragraph.

Carsten Dominik 16 年之前
父节点
当前提交
1b655ff4af
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 2 0
      lisp/ChangeLog
  2. 2 2
      lisp/org-exp.el

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org-exp.el (org-export-html-format-image): Add the / to the end
 	of the <img> tag.
+	(org-export-format-source-code): Surround example by empty lines,
+	to make sure it will not be inside a paragraph.
 
 	* org.el (org-ido-switchb): New function.
 

+ 2 - 2
lisp/org-exp.el

@@ -2260,9 +2260,9 @@ backends, it converts the segment into an EXAMPLE segment."
 		   (point-min) (point-max)))))
 	  (if (string-match "<pre\\([^>]*\\)>\n?" htmltext)
 	      (setq htmltext (replace-match
-			      (format "<pre class=\"src src-%s\">" lang)
+			      (format "<pre class=\"src src-%s\">\n" lang)
 			      t t htmltext)))
-	  (concat "#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n"))))
+	  (concat "\n#+BEGIN_HTML\n" htmltext "\n#+END_HTML\n\n"))))
      (t
       ;; This is not HTML, so just make it an example.
       (when (equal lang "org")