summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-17 03:40:28 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-17 03:40:28 +0000
commit7a04caeea898fa3d0a19a48cdafc49596ecf8c04 (patch)
tree2e53570966b0a808c0c01c0ef24a5a1fd16a26f3 /src
parent1855af4be596e464cac158a4c378af350198506e (diff)
Escape non-breaking space in SGML as '&nbsp;' 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
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Entities.hs3
1 files changed, 2 insertions, 1 deletions
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 =
'<' -> "&lt;"
'>' -> "&gt;"
'"' -> "&quot;"
+ '\160' -> "&nbsp;"
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