aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index f0643c91b..cddc57850 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -180,7 +180,7 @@ valToYaml (SimpleVal x)
if hasNewlines x
then hang 0 ("|" <> cr) x
else if any hasPunct x
- then "'" <> fmap escapeSingleQuotes x <> "'"
+ then "\"" <> fmap escapeInDoubleQuotes x <> "\""
else x
where
hasNewlines NewLine = True
@@ -192,7 +192,7 @@ valToYaml (SimpleVal x)
isYamlPunct = (`elem` ['-','?',':',',','[',']','{','}',
'#','&','*','!','|','>','\'','"',
'%','@','`',',','[',']','{','}'])
- escapeSingleQuotes = T.replace "'" "''"
+ escapeInDoubleQuotes = T.replace "\"" "\\\"" . T.replace "\\" "\\\\"
valToYaml _ = empty
-- | Return markdown representation of document.