@@ -102,7 +102,7 @@ jsonToFill (Object o) =
102102 (M. keys o)
103103jsonToFill (Array v) =
104104 Fill $ \ attrs (path, tpl) lib ->
105- V. foldr mappend " " <$> V. mapM (\ e -> unFill (jsonToFill e) attrs (path, tpl) lib) v
105+ V. foldr mappend " " <$> V. mapM (\ e -> unFill (jsonToFillArrayItem e) attrs (path, tpl) lib) v
106106jsonToFill (String s) = rawTextFill s
107107jsonToFill (Number n) = case floatingOrInteger n of
108108 Left r -> rawTextFill $ tshow (r :: Double )
@@ -111,6 +111,18 @@ jsonToFill (Bool True) = rawTextFill $ tshow True
111111jsonToFill (Bool False ) = rawTextFill " <!-- JSON field found, but value is false. -->"
112112jsonToFill (Null ) = rawTextFill " <!-- JSON field found, but value is null. -->"
113113
114+ jsonToFillArrayItem :: Value -> Fill s
115+ jsonToFillArrayItem o@ (Object _) = jsonToFill o
116+ jsonToFillArrayItem a@ (Array _) = jsonToFill a
117+ jsonToFillArrayItem (String s) = fillChildrenWith $ subs [(" wpArrayItem" , rawTextFill s)]
118+ jsonToFillArrayItem (Number n) =
119+ case floatingOrInteger n of
120+ Left r -> fillChildrenWith $ subs [(" wpArrayItem" , textFill $ tshow (r :: Double ))]
121+ Right i -> fillChildrenWith $ subs [(" wpArrayItem" , textFill $ tshow (i :: Integer ))]
122+ jsonToFillArrayItem b@ (Bool True ) = jsonToFill b
123+ jsonToFillArrayItem b@ (Bool False ) = jsonToFill b
124+ jsonToFillArrayItem n@ (Null ) = jsonToFill n
125+
114126wpCustomAggregateFill :: Wordpress b -> Fill s
115127wpCustomAggregateFill wp =
116128 useAttrs (a " endpoint" ) (customAggregateFill wp)
0 commit comments