From e02fb214527c291be499df70e89746649910d1b8 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Thu, 19 Jul 2007 08:09:17 +0000 Subject: 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 --- src/Text/Pandoc/Writers/Markdown.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Text/Pandoc/Writers') 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 -- cgit v1.2.3