Typst writer: fix alignment issue in lists.

It's an aesthetic issue only; the first line had an
extra space indent after the list marker.
This commit is contained in:
John MacFarlane
2023-03-27 18:52:57 -07:00
parent f97ab76f81
commit ae8ba75c0a
2 changed files with 93 additions and 92 deletions
+3 -2
View File
@@ -146,14 +146,14 @@ blockToTypst block =
text (show start) )) $$
x $$
"]"
items' <- mapM (fmap chomp . listItemToTypst 2 ("+ ")) items
items' <- mapM (fmap chomp . listItemToTypst 2 ("+")) items
return $ addBlock
(if isTightList items
then vcat items'
else vsep items')
$$ blankline
BulletList items -> do
items' <- mapM (fmap chomp . listItemToTypst 2 "- ") items
items' <- mapM (fmap chomp . listItemToTypst 2 "-") items
return $ (if isTightList items
then vcat items'
else vsep items') $$ blankline
@@ -209,6 +209,7 @@ defListItemToTypst (term, defns) = do
defns' <- mapM blocksToTypst defns
return $ nowrap ("/ " <> term' <> ": " <> "#block[") $$
chomp (vcat defns') $$ "]"
listItemToTypst :: PandocMonad m => Int -> Doc Text -> [Block] -> TW m (Doc Text)
listItemToTypst ind marker blocks = do
contents <- blocksToTypst blocks