From 7a04caeea898fa3d0a19a48cdafc49596ecf8c04 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 17 Feb 2007 03:40:28 +0000 Subject: 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 --- src/Text/Pandoc/Entities.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Entities.hs b/src/Text/Pandoc/Entities.hs index 0b77ea334..eaa1cd158 100644 --- a/src/Text/Pandoc/Entities.hs +++ b/src/Text/Pandoc/Entities.hs @@ -87,11 +87,12 @@ escapeSGMLChar x = '<' -> "<" '>' -> ">" '"' -> """ + '\160' -> " " c -> [c] -- | True if the character needs to be escaped. needsEscaping :: Char -> Bool -needsEscaping c = c `elem` "&<>\"" +needsEscaping c = c `elem` "&<>\"\160" -- | Escape string as needed for SGML. Entity references are not preserved. escapeSGMLString :: String -> String -- cgit v1.2.3