diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-10-07 23:03:14 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-10-07 23:05:51 -0700 |
commit | 1be0f0fba8d860b960e79442a891fce6b1aca192 (patch) | |
tree | 8a8be459bd7d03e5509382029ba65f2433969240 /src/Text | |
parent | a520181cdbfa69b4c9a0432e12847cd7d666d41f (diff) | |
download | pandoc-1be0f0fba8d860b960e79442a891fce6b1aca192.tar.gz |
Use double quotes for YAML metadata.
Closes #6727.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Markdown.hs | 4 |
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. |