git.iko.soy/typeable/pandoc
on master help sign in
Escape non-breaking space in SGML as ' ' instead of

printing a unicode non-breaking space, which is hard to distinguish visually from a regular space. (Resolves issue #3.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@540 788f1e2b-df1e-0410-8736-df70ead52e1b

commit7a04caeea898fa3d0a19a48cdafc49596ecf8c04 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 17 Feb 2007, 03:40 (20 years ago) parent1855af4
1 file changed+2−1
src/Text/Pandoc/Entities.hs+2−1
src/Text/Pandoc/Entities.hs+2−1
@@ -87,11 +87,12 @@ escapeSGMLChar x =
8787 '<' -> "&lt;"
8888 '>' -> "&gt;"
8989 '"' -> "&quot;"
90+ '\160' -> "&nbsp;"
9091 c -> [c]
9192
9293-- | True if the character needs to be escaped.
9394needsEscaping :: Char -> Bool
94−needsEscaping c = c `elem` "&<>\""
95+needsEscaping c = c `elem` "&<>\"\160"
9596
9697-- | Escape string as needed for SGML. Entity references are not preserved.
9798escapeSGMLString :: String -> String