diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-19 08:09:17 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-19 08:09:17 +0000 |
commit | e02fb214527c291be499df70e89746649910d1b8 (patch) | |
tree | 6311eab038c046f6903040454293133d66f5d3c6 /src | |
parent | 7d2c9c6fe6458a6b15fa63fe7ee0651a57e5ce32 (diff) | |
download | pandoc-e02fb214527c291be499df70e89746649910d1b8.tar.gz |
Refactored character escaping in Text.Pandoc.Writers.Markdown using
escapeCharAsString.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@739 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 6792a1935..764a146ac 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -105,16 +105,10 @@ wrappedMarkdown opts sect = do chunks' <- mapM (inlineListToMarkdown opts) chunks return $ fsep chunks' --- | Escape nonbreaking space as entity -escapeNbsp "" = "" -escapeNbsp ('\160':xs) = " " ++ escapeNbsp xs -escapeNbsp str = - let (a,b) = break (=='\160') str in - a ++ escapeNbsp b - -- | Escape special characters for Markdown. escapeString :: String -> String -escapeString = backslashEscape "`<\\*_^" . escapeNbsp +escapeString = backslashEscape "`<\\*_^" . + escapeCharAsString '\160' " " -- | Convert bibliographic information into Markdown header. metaToMarkdown :: WriterOptions -> Meta -> State WriterState Doc |