Skip to content

Commit 6accb0b

Browse files
committed
Typst writer: omit blank line at end of block.
This is just a cosmetic change; it is not semantically significant. Closes #11844.
1 parent d138bf2 commit 6accb0b

6 files changed

Lines changed: 2 additions & 11 deletions

File tree

src/Text/Pandoc/Writers/Typst.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,15 @@ blockToTypst block =
403403
contents <- blocksToTypst blocks
404404
return $ "#block" <> toTypstPropsListParens typstAttrs <> "["
405405
$$ toTypstPoundSetText typstTextAttrs
406-
$$ contents
406+
$$ chomp contents
407407
$$ ("]" <+> lab)
408408

409409
defListItemToTypst :: PandocMonad m => ([Inline], [[Block]]) -> TW m (Doc Text)
410410
defListItemToTypst (term, defns) = do
411411
modify $ \st -> st{ stEscapeContext = TermContext }
412412
term' <- inlinesToTypst term
413413
modify $ \st -> st{ stEscapeContext = NormalContext }
414-
defns' <- mapM blocksToTypst defns
414+
defns' <- mapM (fmap chomp . blocksToTypst) defns
415415
return $
416416
case defns of
417417
[[Plain _]] -> hang 4 (nowrap ("/ " <> term' <> ": ")) (vcat defns')

test/command/10965.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ This text should be in English.
77
#block[
88
#set text(lang: "en");
99
This text should be in English.
10-
1110
]
1211
```
1312

@@ -20,7 +19,6 @@ Ce texte devrait être en français.
2019
#block[
2120
#set text(lang: "fr");
2221
Ce texte devrait être en français.
23-
2422
]
2523
```
2624

@@ -33,7 +31,6 @@ Dieser Text sollte auf Deutsch sein.
3331
#block[
3432
#set text(lang: "de");
3533
Dieser Text sollte auf Deutsch sein.
36-
3734
]
3835
```
3936

@@ -45,6 +42,5 @@ This should not have lang set.
4542
^D
4643
#block[
4744
This should not have lang set.
48-
4945
]
5046
```

test/command/11583.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@
1111
+ item
1212
+ item
1313
+ item
14-
1514
]
1615
```

test/command/11794.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Hello
66
^D
77
#block[
88
Hello
9-
109
] <foo>
1110
1211
```

test/command/9387.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
^D
88
#block[
99
test
10-
1110
] #label("my label")
1211
See #link(label("my label"))[my label].
1312

test/writer.typst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,6 @@ And nested without indentation:
542542
#block[
543543
#block[
544544
foo
545-
546545
]
547546
]
548547
#block[
@@ -557,7 +556,6 @@ Here's a simple block:
557556

558557
#block[
559558
foo
560-
561559
]
562560
This should be a code block, though:
563561

0 commit comments

Comments
 (0)