jgm / typst-hs

Haskell library for parsing and evaluating typst
Other
44 stars 5 forks source link

Pandoc error on multline string #20

Closed ntjess closed 11 months ago

ntjess commented 11 months ago
#let a = "
This is a
multiline string
"

This is a valid typst document but results in the following pandoc error:

".\tmp.typ" (line 1, column 11):
unexpected "\n"
expecting "\"" or "\\"
jgm commented 11 months ago

Can you point to any typst documentation on multiline strings?

ntjess commented 11 months ago

Just looked quickly through docs, issues, and typst codebase tests. I can't seem to find any references to this behavior.

@laurmaedje Is this public behavior, or is it not guaranteed that future version of typst preserve and allow newlines in a string expression? If it's public, it might be good to add a comment in the docs

laurmaedje commented 11 months ago

There is no guarantee in the sense that breaking changes might occur, but it's public and intended behaviour.

jgm commented 11 months ago

Is there any special syntax? Can you just put line breaks inside any string, or does the initial " need to be followed by a newline and the final " preceded by one?

laurmaedje commented 11 months ago

You can just put linebreaks anywhere.