From 2e1f17a09fa01fe8c265b3acf3e6a55d19a67a42 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 27 May 2024 14:53:00 -0700 Subject: [PATCH] Typst reader: fix an incomplete pattern match. See #9807. --- src/Text/Pandoc/Readers/Typst.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/Typst.hs b/src/Text/Pandoc/Readers/Typst.hs index 39db3fda8..c2e1983ac 100644 --- a/src/Text/Pandoc/Readers/Typst.hs +++ b/src/Text/Pandoc/Readers/Typst.hs @@ -105,8 +105,10 @@ pInline = try $ do B.math . writeTeX <$> pMathMany (Seq.singleton res) Elt name@(Identifier tname) pos fields -> do labs <- sLabels <$> getState - labelTarget <- (do VLabel t <- getField "target" fields - True <$ guard (t `elem` labs)) + labelTarget <- (do result <- getField "target" fields + case result of + VLabel t | t `elem` labs -> pure True + _ -> pure False) <|> pure False if tname == "ref" && not labelTarget then do