@@ -102,27 +102,19 @@ dateToMetaValue date =
102102 | otherwise -> printf "%04d" y
103103 _ -> mempty
104104
105−metaValueToReference :: (Text -> Bool) -- ^ predicate on IDs to include
106− -> MetaValue
105+metaValueToReference :: MetaValue
107106 -> Maybe (Reference Inlines)
108−metaValueToReference idpred (MetaMap m) = do
107+metaValueToReference (MetaMap m) = do
109108 let m' = M.mapKeys normalizeKey m
110109 id' <- M.lookup "id" m' >>= metaValueToText
111− let mbotherids =
112− case M.lookup "other-ids" m' of
113− Just (MetaList xs) -> map metaValueToText xs
114− _ -> []
115− if idpred id' || any (maybe False idpred) mbotherids
116− then do
117− type' <- (M.lookup "type" m' >>= metaValueToText) <|> pure ""
118− let m'' = M.delete "id" $ M.delete "type" m'
119− let vars = M.mapKeys toVariable $ M.mapWithKey metaValueToVal m''
120− return $ Reference { referenceId = ItemId id'
121− , referenceType = type'
122− , referenceDisambiguation = Nothing
123− , referenceVariables = vars }
124− else Nothing
125−metaValueToReference _ _ = Nothing
110+ type' <- (M.lookup "type" m' >>= metaValueToText) <|> pure ""
111+ let m'' = M.delete "id" $ M.delete "type" m'
112+ let vars = M.mapKeys toVariable $ M.mapWithKey metaValueToVal m''
113+ return $ Reference { referenceId = ItemId id'
114+ , referenceType = type'
115+ , referenceDisambiguation = Nothing
116+ , referenceVariables = vars }
117+metaValueToReference _ = Nothing
126118
127119metaValueToVal :: Text -> MetaValue -> Val Inlines
128120metaValueToVal k v