From 1be0f0fba8d860b960e79442a891fce6b1aca192 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 7 Oct 2020 23:03:14 -0700 Subject: Use double quotes for YAML metadata. Closes #6727. --- src/Text/Pandoc/Writers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') 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. -- cgit v1.2.3