Skip to content

Typst: Strong emphasis function cannot take multiline variable #9807

Closed
@axelkar

Description

@axelkar

Explain the problem.

When trying to pass a multiline (so not #let foo = [bar baz]) content variable to the strong emphasis function, pandoc errors while typst does not.

pandoc --from typst --to html5 --no-highlight
#let foo = [
  bar baz
]
*#foo*
// Also this:
//#strong(foo)

It errors with the following error:

(line 1, column 2): unexpected Elt {eltName = Identifier "parbreak", eltPos = Just (line 1, column 2),
eltFields = fromList []} or Elt {eltName = Identifier "strong", eltPos = Just (line 1, column 2), eltFields
= fromList [(Identifier "body",VContent (fromList [Elt {eltName = Identifier "text", eltPos = Just (line 1,
column 2), eltFields = fromList [(Identifier "body",VContent (fromList [Txt "\nbar baz"]))]},Elt {eltName
= Identifier "parbreak", eltPos = Just (line 1, column 2), eltFields = fromList []}]))]}
expecting end of input
Pattern match failure in 'do' block at src/Text/Pandoc/Readers/Typst.hs:108:26-33

Pandoc version?
pandoc version 3.2 on https://pandoc.org/try

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions