Add support for tight terms in Typst writer (#11748)

This just affects whether a blank line is emitted in the markup.
Note that pandoc's default template contains a show rule for
terms that will make these blank lines irrelevant, but this change
allows one to use tight lists with custom templates.
This commit is contained in:
Amir Dekel
2026-07-08 10:42:56 +02:00
committed by GitHub
parent 7b1021eb3e
commit 59c5eab2a0
2 changed files with 5 additions and 7 deletions
+5 -2
View File
@@ -264,8 +264,11 @@ blockToTypst block =
return $ (if isTightList items
then vcat items'
else vsep items') $$ blankline
DefinitionList items ->
($$ blankline) . vsep <$> mapM defListItemToTypst items
DefinitionList items -> do
let concat' = if all (isTightList . snd) items
then vcat
else vsep
($$ blankline) . concat' <$> mapM defListItemToTypst items
Table (ident,tabclasses,tabkvs) (Caption _ caption) colspecs thead tbodies tfoot -> do
let lab = toLabel FreestandingLabel ident
capt' <- if null caption
-5
View File
@@ -447,11 +447,9 @@ Tight using spaces:
/ apple: #block[
red fruit
]
/ orange: #block[
orange fruit
]
/ banana: #block[
yellow fruit
]
@@ -461,11 +459,9 @@ Tight using tabs:
/ apple: #block[
red fruit
]
/ orange: #block[
orange fruit
]
/ banana: #block[
yellow fruit
]
@@ -511,7 +507,6 @@ red fruit
computer
]
/ orange: #block[
orange fruit