Typst writer: don't add a carriage return after \ for hard break.

They are not necessary.  Note that they can still be included if
you use `--wrap=preserve` and add a newline in your source
document.

This fixes issues with line breaks in headings.
Closes #11446.
This commit is contained in:
John MacFarlane
2026-02-07 10:57:50 +01:00
parent a27740b00b
commit ebd425d867
3 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -443,7 +443,7 @@ inlineToTypst inline =
WrapPreserve -> return cr
WrapAuto -> return space
WrapNone -> return space
LineBreak -> return (space <> "\\" <> cr)
LineBreak -> return (space <> "\\" <> space)
Math mathType str -> do
res <- convertMath TM.writeTypst mathType str
case res of
+1 -3
View File
@@ -3,9 +3,7 @@
columns: (30%, 30%, 20%, 20%),
align: (center,left,left,left,),
table.header(table.cell(align: center)[Name], table.cell(align: center)[Capital], table.cell(align: center)[Population
\
(in 2018)], table.cell(align: center)[Area \
(in km#super[2])],),
\ (in 2018)], table.cell(align: center)[Area \ (in km#super[2])],),
table.hline(),
[Denmark], [Copenhagen], [5,809,502], [43,094],
[Finland], [Helsinki], [5,537,364], [338,145],
+1 -2
View File
@@ -194,8 +194,7 @@ item.
Here's one with a bullet. \* criminey.
There should be a hard line break \
here.
There should be a hard line break \ here.
#horizontalrule