From 9009a7e4a8e8b9ddbf3327ae8a37f4bcb5df1b92 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 1 Jul 2013 21:00:04 -0700 Subject: Markdown writer: Commas are okay in plain yaml scalars. It's just commas with brackets that can cause problems. --- src/Text/Pandoc/Writers/Markdown.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index aa29ebce1..2995f63cf 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -135,7 +135,7 @@ jsonToYaml (String "") = empty jsonToYaml (String s) = case T.unpack s of x | '\n' `elem` x -> hang 2 ("|" <> cr) $ text x - | not (any (`elem` x) "\"'#:[]{},?-") -> text x + | not (any (`elem` x) "\"'#:[]{}?-") -> text x | otherwise -> text $ "'" ++ substitute "'" "''" x ++ "'" jsonToYaml (Bool b) = text $ show b jsonToYaml (Number n) = text $ show n -- cgit v1.2.3