In writing Markdown, print unicode nonbreaking space
(160) as " ", since otherwise it is hard to distinguish from a regular space. (Addresses Issue #3.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@541 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
parent
7a04caeea8
commit
7d3382e9f0
1 changed files with 8 additions and 1 deletions
|
@ -48,9 +48,16 @@ writeMarkdown options (Pandoc meta blocks) =
|
|||
else empty in
|
||||
render $ head <> body
|
||||
|
||||
-- | 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 "`<\\*_^"
|
||||
escapeString = backslashEscape "`<\\*_^" . escapeNbsp
|
||||
|
||||
-- | Take list of inline elements and return wrapped doc.
|
||||
wrappedMarkdown :: [Inline] -> Doc
|
||||
|
|
Loading…
Add table
Reference in a new issue