git.iko.soy/typeable/pandoc
on master help sign in
Escape '\160' as " ", not " " in XML.
7447eccfiddlosopher
Text/Pandoc/XML.hs+6−6
@@ -38,12 +38,12 @@ import Text.PrettyPrint.HughesPJ
38-- | Escape one character as needed for XML.
38-- | Escape one character as needed for XML.
39escapeCharForXML :: Char -> String
39escapeCharForXML :: Char -> String
40escapeCharForXML x = case x of
40escapeCharForXML x = case x of
41− '&' -> "&"
41+ '&' -> "&"
42− '<' -> "&lt;"
42+ '<' -> "&lt;"
43− '>' -> "&gt;"
43+ '>' -> "&gt;"
44− '"' -> "&quot;"
44+ '"' -> "&quot;"
45− '\160' -> "&nbsp;"
45+ '\160' -> "&#160;"
46− c -> [c]
46+ c -> [c]
47
47
48-- | True if the character needs to be escaped.
48-- | True if the character needs to be escaped.
49needsEscaping :: Char -> Bool
49needsEscaping :: Char -> Bool
tests/writer.docbook+3−3
@@ -606,7 +606,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
606 Should not be a list item:
606 Should not be a list item:
607 </para>
607 </para>
608 <para>
608 <para>
609− M.A.&nbsp;2007
609+ M.A.&#160;2007
610 </para>
610 </para>
611 <para>
611 <para>
612 B. Williams
612 B. Williams
@@ -795,12 +795,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{
795 <para>
795 <para>
796 Superscripts: a<superscript>bc</superscript>d
796 Superscripts: a<superscript>bc</superscript>d
797 a<superscript><emphasis>hello</emphasis></superscript>
797 a<superscript><emphasis>hello</emphasis></superscript>
798− a<superscript>hello&nbsp;there</superscript>.
798+ a<superscript>hello&#160;there</superscript>.
799 </para>
799 </para>
800 <para>
800 <para>
801 Subscripts: H<subscript>2</subscript>O,
801 Subscripts: H<subscript>2</subscript>O,
802 H<subscript>23</subscript>O,
802 H<subscript>23</subscript>O,
803− H<subscript>many&nbsp;of&nbsp;them</subscript>O.
803+ H<subscript>many&#160;of&#160;them</subscript>O.
804 </para>
804 </para>
805 <para>
805 <para>
806 These should not be superscripts or subscripts, because of the
806 These should not be superscripts or subscripts, because of the