jgm / typst-hs

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

error from typst input: unexpected end of input #49

Closed karuboniru closed 6 months ago

karuboniru commented 6 months ago

Explain the problem. test.typ:

测试文本*加粗*。

Run command pandoc test.typ -o test1.md, get:

"test.typ" (line 4, column 1):
unexpected end of input
expecting new-line, "*", "=", "//", "/*", "\\", "_", "$", "-", "+", digit, "/", "http://", "https://", letter or digit, "```", "`", "~", ".", "'", "\"", "<", "@", "#" or "["

The *。 is what causing the issue, by

can workaround this.

Pandoc version? What version of pandoc are you using, on what OS? (If it's not the latest release, please try with the latest release before reporting the issue.)

pandoc -v                  
pandoc 3.2-nightly-2024-05-15
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /var/home/yan/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

from docker.io/pandoc/latex:edge

jgm commented 6 months ago

The typst documentation says that * strong emphasis "only works at word boundaries." Is there a word boundary at the first * in 测试文本*加粗*? Or is the typst documentation somehow incomplete?

jgm commented 6 months ago

https://typst.app/docs/reference/model/strong/

jgm commented 6 months ago

Relevant but undocumented! https://github.com/typst/typst/pull/2648