summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2024-03-17 11:39:32 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2024-03-17 11:39:32 -0700
commit2c5d66cb5cecaec273c3575a1a45b9683f7d924b (patch)
tree7b1c50188bfc38ddbbd3d6bf645a1e27d6e85ba6 /src/Text/Pandoc
parenta6392207fc560fff2d136132ecd6219b7e5f6bfd (diff)
Typst writer: use `kind: image` for image figures.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/Typst.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
index 9f3c9a0bf..09bc65e8c 100644
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -201,14 +201,16 @@ blockToTypst block =
_ -> brackets <$> blocksToTypst blocks
let lab = toLabel FreestandingLabel ident
let kind = case blocks of
- Table{}:_ -> "table"
- CodeBlock{}:_ -> "code"
- _ -> "auto"
+ Table{}:_ -> "kind: table"
+ CodeBlock{}:_ -> "kind: code"
+ Para [Image{}]:_ -> "kind: image"
+ Plain [Image{}]:_ -> "kind: image"
+ _ -> mempty
return $ "#figure(" <> nest 2 ((contents <> ",")
$$
("caption: [" $$ nest 2 caption $$ "],")
$$
- "kind: " <> literal kind
+ kind
)
$$ ")" $$ lab $$ blankline
Div (ident,_,_) (Header lev ("",cls,kvs) ils:rest) ->