Markdown writer: Commas are okay in plain yaml scalars.

It's just commas with brackets that can cause problems.
This commit is contained in:
John MacFarlane 2013-07-01 21:00:04 -07:00
parent e7a68fc7e8
commit 9009a7e4a8
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -2,7 +2,7 @@
author:
- John MacFarlane
- Anonymous
date: 'July 17, 2006'
date: July 17, 2006
title: Pandoc Test Suite
...