git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: Commas are okay in plain yaml scalars.
9009a7eJohn MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -135,7 +135,7 @@ jsonToYaml (String "") = empty
135jsonToYaml (String s) =
135jsonToYaml (String s) =
136 case T.unpack s of
136 case T.unpack s of
137 x | '\n' `elem` x -> hang 2 ("|" <> cr) $ text x
137 x | '\n' `elem` x -> hang 2 ("|" <> cr) $ text x
138− | not (any (`elem` x) "\"'#:[]{},?-") -> text x
138+ | not (any (`elem` x) "\"'#:[]{}?-") -> text x
139 | otherwise -> text $ "'" ++ substitute "'" "''" x ++ "'"
139 | otherwise -> text $ "'" ++ substitute "'" "''" x ++ "'"
140jsonToYaml (Bool b) = text $ show b
140jsonToYaml (Bool b) = text $ show b
141jsonToYaml (Number n) = text $ show n
141jsonToYaml (Number n) = text $ show n
tests/writer.markdown+1−1
@@ -2,7 +2,7 @@
2author:
2author:
3- John MacFarlane
3- John MacFarlane
4- Anonymous
4- Anonymous
5−date: 'July 17, 2006'
5+date: July 17, 2006
6title: Pandoc Test Suite
6title: Pandoc Test Suite
7...
7...
8
8