소스 검색

Mark style definitions as unparsed CDATA.

Org-mode does sometimes included CSS definitions directly
into an exported XHTML file.  To pass validation tests
for XHTML, these sections need to be wrapped in
order to pass as CDATA, not PCDATA.  This patch
(written by Sebastian Rose) does implement this change.
It also fixes some typos.
Carsten Dominik 16 년 전
부모
커밋
bdc93a9cd2
3개의 변경된 파일10개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      doc/org.texi
  2. 4 0
      lisp/ChangeLog
  3. 4 1
      lisp/org-exp.el

+ 2 - 2
doc/org.texi

@@ -8230,7 +8230,7 @@ directory on the local machine.
          :publishing-directory "~/public_html"
          :section-numbers nil
          :table-of-contents nil
-         :style "<link rel="stylesheet"
+         :style "<link rel=\"stylesheet\"
                 href=\"../other/mystyle.css\"
                 type=\"text/css\">")))
 @end lisp
@@ -8267,7 +8267,7 @@ right place on the web server, and publishing images to it.
           :headline-levels 3
           :section-numbers nil
           :table-of-contents nil
-          :style "<link rel="stylesheet"
+          :style "<link rel=\"stylesheet\"
                   href=\"../other/mystyle.css\" type=\"text/css\">"
           :auto-preamble t
           :auto-postamble nil)

+ 4 - 0
lisp/ChangeLog

@@ -1,5 +1,9 @@
 2008-11-02  Carsten Dominik  <dominik@science.uva.nl>
 
+	* org-exp.el (org-export-html-style)
+	(org-export-html-style-default): Mark style definitions as
+	unparsed CDATA.
+
 	* org-publish.el (org-publish-validate-link): Function
 	re-introduced.
 

+ 4 - 1
lisp/org-exp.el

@@ -492,6 +492,7 @@ Org-mode file."
 
 (defconst org-export-html-style-default
 "<style type=\"text/css\">
+ <![CDATA[
   html { font-family: Times, serif; font-size: 12pt; }
   .title  { text-align: center; }
   .todo   { color: red; }
@@ -518,7 +519,7 @@ Org-mode file."
                                white-space:nowrap; }
   .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
                                  font-weight:bold; }
-
+ ]]>
 </style>"
   "The default style specification for exported HTML files.
 Please use the variables `org-export-html-style' and
@@ -547,11 +548,13 @@ you should consider to include definitions for the following classes:
 For example, a valid value would be:
 
    <style type=\"text/css\">
+    <![CDATA[
        p { font-weight: normal; color: gray; }
        h1 { color: black; }
       .title { text-align: center; }
       .todo, .timestamp-kwd { color: red; }
       .done { color: green; }
+    ]]>
    </style>
 
 If you'd like to refer to en external style file, use something like