git.iko.soy/typeable/pandoc
on master help sign in
Escape '\160' as " ", not " " in XML.

"nbsp" isn't a predefined XML entity. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1303 788f1e2b-df1e-0410-8736-df70ead52e1b

commit7447ecc255af14971c9bb2e035aedb7e386e6aa0 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 13 Jul 2008, 16:31 (18 years ago) parent2e4592b
2 files changed+9−9
Text/Pandoc/XML.hs+6−6 tests/writer.docbook+3−3
Text/Pandoc/XML.hs+6−6
@@ -38,12 +38,12 @@ import Text.PrettyPrint.HughesPJ
3838-- | Escape one character as needed for XML.
3939escapeCharForXML :: Char -> String
4040escapeCharForXML x = case x of
41− '&' -> "&amp;"
42− '<' -> "&lt;"
43− '>' -> "&gt;"
44− '"' -> "&quot;"
45− '\160' -> "&nbsp;"
46− c -> [c]
41+ '&' -> "&amp;"
42+ '<' -> "&lt;"
43+ '>' -> "&gt;"
44+ '"' -> "&quot;"
45+ '\160' -> "&#160;"
46+ c -> [c]
4747
4848-- | True if the character needs to be escaped.
4949needsEscaping :: Char -> Bool
tests/writer.docbook+3−3
@@ -606,7 +606,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
606606 Should not be a list item:
607607 </para>
608608 <para>
609− M.A.&nbsp;2007
609+ M.A.&#160;2007
610610 </para>
611611 <para>
612612 B. Williams
@@ -795,12 +795,12 @@ These should not be escaped: \$ \\ \&gt; \[ \{
795795 <para>
796796 Superscripts: a<superscript>bc</superscript>d
797797 a<superscript><emphasis>hello</emphasis></superscript>
798− a<superscript>hello&nbsp;there</superscript>.
798+ a<superscript>hello&#160;there</superscript>.
799799 </para>
800800 <para>
801801 Subscripts: H<subscript>2</subscript>O,
802802 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.
804804 </para>
805805 <para>
806806 These should not be superscripts or subscripts, because of the