git.iko.soy/typeable/pandoc
on master help sign in
metaToJSON: treat digits starting with 0 as a string...
c4a81fbJohn MacFarlane
src/Text/Pandoc/Writers/Shared.hs+3
@@ -109,6 +109,9 @@ metaValueToJSON blockWriter inlineWriter (MetaMap metamap) = toJSON <$>
109metaValueToJSON blockWriter inlineWriter (MetaList xs) = toJSON <$>
109metaValueToJSON blockWriter inlineWriter (MetaList xs) = toJSON <$>
110 Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs
110 Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs
111metaValueToJSON _ _ (MetaBool b) = return $ toJSON b
111metaValueToJSON _ _ (MetaBool b) = return $ toJSON b
112+metaValueToJSON _ inlineWriter (MetaString s@('0':_)) =
113+ -- don't treat string with leading 0 as string (#5479)
114+ toJSON <$> inlineWriter (Builder.toList (Builder.text s))
112metaValueToJSON _ inlineWriter (MetaString s) =
115metaValueToJSON _ inlineWriter (MetaString s) =
113 case safeRead s of
116 case safeRead s of
114 Just (n :: Scientific) -> return $ Aeson.Number n
117 Just (n :: Scientific) -> return $ Aeson.Number n