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

quote is not supported #9413

Closed
Doublonmousse opened this issue Feb 4, 2024 · 5 comments
Closed

quote is not supported #9413

Doublonmousse opened this issue Feb 4, 2024 · 5 comments

Comments

@Doublonmousse
Copy link

using #quote in a typst document is not supported, and fails with

"quote/quote.typ" (line 1, column 2):
unexpected Elt {eltName = Identifier "parbreak", eltPos = Just "quote/quote.typ" (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 or Cannot convert VNone to boolean

Reproduction : https://github.com/Doublonmousse/pandoc-typst-reproducer/tree/main/quote

@jgm
Copy link
Owner

jgm commented Feb 5, 2024

Support was added in d57f3d5
What version of pandoc are you testing with?

@jgm jgm closed this as completed Feb 5, 2024
@Doublonmousse
Copy link
Author

I'm using pandoc version 3.1.11.1 on mac (brew, apple M2).

There is some quote support but it will fail on the shorthand version (using #quote[content] for the body content instead of #quote(content))
This code will work :

#quote([test])

But the shorthanded version

#quote[
  This is not supported
]

will fail with

"quote/quote.typ" (line 1, column 2):
unexpected Elt {eltName = Identifier "parbreak", eltPos = Just "quote/quote.typ" (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 or Cannot convert VNone to boolean

@jgm
Copy link
Owner

jgm commented Feb 5, 2024

OK, reopening. Note: these all work:

#quote[hi]
#quote[This is
not supported]
#quote[This is
  not supported]
#quote[
hi]

(though the last puts a space at the beginning of the quote, which is presumably not what typst does).
This fails:

#quote[
hi
]

@jgm jgm reopened this Feb 5, 2024
@jgm
Copy link
Owner

jgm commented Feb 5, 2024

This also fails:

#quote([
 this is not supported
])

So does:

#emph[
  this is not supported
]

So this issue is about brace parsing, nothing specific to quotes.

@jgm
Copy link
Owner

jgm commented Feb 5, 2024

This is how typst-hs evaluates your original case:

document(body: { quote(body: { text(body: [
This is not supported]), 
                               parbreak() }), 
                 parbreak() })

So I guess the problem comes up in pandoc, which must interpret this.

@jgm jgm transferred this issue from jgm/typst-hs Feb 5, 2024
@jgm jgm closed this as completed in bab30ea Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants