Skip to content

Commit

Permalink
Typst reader: handle blockish content for link element.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgm committed Jul 6, 2023
1 parent d5bdfe2 commit 001531e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Text/Pandoc/Readers/Typst.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 001531e

Please sign in to comment.