@@ -39,7 +39,7 @@ import Text.Pandoc.Writers.Shared
3939import Text.Pandoc.Options
4040import Text.Pandoc.Parsing hiding (blankline, char, space)
4141import Data.List ( group, isPrefixOf, find, intersperse, transpose, sortBy )
42−import Data.Char ( isSpace )
42+import Data.Char ( isSpace, isPunctuation )
4343import Data.Ord ( comparing )
4444import Text.Pandoc.Pretty
4545import Control.Monad.State
@@ -143,7 +143,7 @@ jsonToYaml (Object hashmap) =
143143 | otherwise -> (k' <> ":") $$ x
144144 (k', Object _, x) -> (k' <> ":") $$ nest 2 x
145145 (_, String "", _) -> empty
146− (k', _, x) -> k' <> ":" <> space <> x)
146+ (k', _, x) -> k' <> ":" <> space <> hang 2 "" x)
147147 $ sortBy (comparing fst) $ H.toList hashmap
148148jsonToYaml (Array vec) =
149149 vcat $ map (\v -> hang 2 "- " (jsonToYaml v)) $ V.toList vec
@@ -151,7 +151,7 @@ jsonToYaml (String "") = empty
151151jsonToYaml (String s) =
152152 case T.unpack s of
153153 x | '\n' `elem` x -> hang 2 ("|" <> cr) $ text x
154− | not (any (`elem` x) "\"'#:[]{}?-") -> text x
154+ | not (any isPunctuation x) -> text x
155155 | otherwise -> text $ "'" ++ substitute "'" "''" x ++ "'"
156156jsonToYaml (Bool b) = text $ show b
157157jsonToYaml (Number n) = text $ show n