mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-28 09:10:48 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user