@@ -76,7 +76,9 @@ processCitations (Pandoc meta bs) = do
7676 let citations = getCitations locale otherIdsMap $ Pandoc meta' bs
7777
7878
79- let linkCites = maybe False truish $ lookupMeta " link-citations" meta
79+ let linkCites = maybe False truish (lookupMeta " link-citations" meta) &&
80+ -- don't link citations if no bibliography to link to:
81+ not (maybe False truish (lookupMeta " suppress-bibliography" meta))
8082 let linkBib = maybe True truish $ lookupMeta " link-bibliography" meta
8183 let opts = defaultCiteprocOptions{ linkCitations = linkCites
8284 , linkBibliography = linkBib }
@@ -479,9 +481,9 @@ isYesValue _ = False
479481insertRefs :: [(Text ,Text )] -> [Text ] -> [Block ] -> Pandoc -> Pandoc
480482insertRefs _ _ [] d = d
481483insertRefs refkvs refclasses refs (Pandoc meta bs) =
482- if isRefRemove meta
483- then Pandoc meta bs
484- else case runState (walkM go (Pandoc meta bs)) False of
484+ case lookupMeta " suppress-bibliography " meta of
485+ Just x | truish x -> Pandoc meta bs
486+ _ -> case runState (walkM go (Pandoc meta bs)) False of
485487 (d', True ) -> d'
486488 (Pandoc meta' bs', False )
487489 -> Pandoc meta' $
@@ -517,10 +519,6 @@ refTitle meta =
517519 Just (MetaBlocks [Para ils]) -> Just ils
518520 _ -> Nothing
519521
520- isRefRemove :: Meta -> Bool
521- isRefRemove meta =
522- maybe False truish $ lookupMeta " suppress-bibliography" meta
523-
524522legacyDateRanges :: Reference Inlines -> Reference Inlines
525523legacyDateRanges ref =
526524 ref{ referenceVariables = M. map go $ referenceVariables ref }
0 commit comments