@@ -109,6 +109,9 @@ metaValueToJSON blockWriter inlineWriter (MetaMap metamap) = toJSON <$>
109109metaValueToJSON blockWriter inlineWriter (MetaList xs) = toJSON <$>
110110 Traversable.mapM (metaValueToJSON blockWriter inlineWriter) xs
111111metaValueToJSON _ _ (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))
112115metaValueToJSON _ inlineWriter (MetaString s) =
113116 case safeRead s of
114117 Just (n :: Scientific) -> return $ Aeson.Number n