aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-07-06 11:47:27 -0700
committerJohn MacFarlane <[email protected]>2023-07-06 11:47:27 -0700
commit001531e604873f43ac41d7729f6fa6c0a86c0bbf (patch)
treef314cdb9d1c7cfcda647bd898764d3d26fa40848
parentd5bdfe2b94c6718a4a325c1bceb8c35206e4bd41 (diff)
Typst reader: handle blockish content for link element.
-rw-r--r--src/Text/Pandoc/Readers/Typst.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Typst.hs b/src/Text/Pandoc/Readers/Typst.hs
index 36ae36bcf..7ac459fbd 100644
--- a/src/Text/Pandoc/Readers/Typst.hs
+++ b/src/Text/Pandoc/Readers/Typst.hs
@@ -28,7 +28,7 @@ import Text.Pandoc.Options
import Text.Pandoc.Definition
import Typst ( parseTypst, evaluateTypst )
import Text.Pandoc.Error (PandocError(..))
-import Text.Pandoc.Shared (tshow)
+import Text.Pandoc.Shared (tshow, blocksToInlines)
import Control.Monad.Except (throwError)
import Control.Monad (MonadPlus (mplus), void, mzero)
import qualified Data.Foldable as F
@@ -451,7 +451,9 @@ inlineHandlers = M.fromList
if "tel:" `T.isPrefixOf` src
then T.drop 4 src
else src
- else pWithContents pInlines body
+ else pWithContents pInlines body <|>
+ pWithContents
+ (B.fromList . blocksToInlines . B.toList <$> pBlocks) body
pure $ B.link src "" description)
,("image", \_ fields -> do
path <- getField "path" fields