浏览代码

HTML export: Add XML declaration

Patch by Sebastian Rose
Carsten Dominik 16 年之前
父节点
当前提交
fbe4f09cd8
共有 2 个文件被更改,包括 7 次插入1 次删除
  1. 4 0
      lisp/ChangeLog
  2. 3 1
      lisp/org-html.el

+ 4 - 0
lisp/ChangeLog

@@ -1,3 +1,7 @@
+2009-05-15  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-html.el (org-export-as-html): Add xml declaration.
+
 2009-05-14  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org.el (org-after-sorting-entries-or-items-hook): New hook.

+ 3 - 1
lisp/org-html.el

@@ -669,7 +669,8 @@ PUB-DIR is set, use this as the publishing directory."
       (unless body-only
 	;; File header
 	(insert (format
-		 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
+		 "<?xml version=\"1.0\" encoding=\"%s\"?>
+<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
                \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
 <html xmlns=\"http://www.w3.org/1999/xhtml\"
 lang=\"%s\" xml:lang=\"%s\">
@@ -686,6 +687,7 @@ lang=\"%s\" xml:lang=\"%s\">
 <body>
 <div id=\"content\">
 "
+		 (or charset "iso-8859-1")
 		 language language (org-html-expand title)
 		 (or charset "iso-8859-1")
 		 date author description keywords