Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typst: Strong emphasis function cannot take multiline variable #9807

Closed
axelkar opened this issue May 26, 2024 · 2 comments
Closed

Typst: Strong emphasis function cannot take multiline variable #9807

axelkar opened this issue May 26, 2024 · 2 comments
Labels

Comments

@axelkar
Copy link

axelkar commented May 26, 2024

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

@axelkar axelkar added the bug label May 26, 2024
@jgm
Copy link
Owner

jgm commented May 27, 2024

It's not entirely clear how we should handle this (though certainly we shouldn't have a pattern match failure!).

Pandoc's Strong element can only contain inline content, and a typst block could be e.g. several paragraphs and a bullet list. That just can't go inside a Strong. I suppose we could add Strong to the inline contents of these things.

jgm added a commit that referenced this issue May 27, 2024
@jgm
Copy link
Owner

jgm commented May 28, 2024

Closed by 372cd1d

@jgm jgm closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants