Skip to content

Commit

Permalink
Typst writer: don't include trailing semicolon after...
Browse files Browse the repository at this point in the history
`@` style citations with suffixes.

Closes #10148.
  • Loading branch information
jgm committed Sep 4, 2024
1 parent 6d41c1b commit b3d721b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/Text/Pandoc/Writers/Typst.hs
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,7 @@ toCite cite = do
then do
suppl <- case citationSuffix cite of
[] -> pure mempty
suff -> (<> endCode) . brackets
<$> inlinesToTypst (eatComma suff)
suff -> brackets <$> inlinesToTypst (eatComma suff)
pure $ "@" <> literal ident' <> suppl
else do
let label = if T.all isIdentChar ident'
Expand Down
18 changes: 18 additions & 0 deletions test/command/10148.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```
% pandoc -t typst
See [@MyPaper].
See [@MyPaper, Equation 1] for details.
See [@MyPaper, Equation 1].
See [@MyPaper, Equation 1; @Other, Figure 1].
^D
See @MyPaper.
See @MyPaper[Equation 1] for details.
See @MyPaper[Equation 1].
See @MyPaper[Equation 1]@Other[Figure 1].
```
2 changes: 1 addition & 1 deletion test/command/9452.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ And just the year [-@something2024].
Here is a sentence @something2024.
With supplement @something2024[p.~3];.
With supplement @something2024[p.~3].
And just the year #cite(<something2024>, form: "year");.
Expand Down

0 comments on commit b3d721b

Please sign in to comment.