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 writer does not escape double forward slashes (//) #8966

Closed
tsamsonov opened this issue Jul 25, 2023 · 0 comments
Closed

Typst writer does not escape double forward slashes (//) #8966

tsamsonov opened this issue Jul 25, 2023 · 0 comments
Labels

Comments

@tsamsonov
Copy link

Explain the problem.
According to Typst syntax, double forward slashes are interpreted as comments. When the source text contains this pattern, the PDF resulting from Typst rendering is missing the remainder of the paragraph. Example is below.

Input markdown:

**Samsonov T.E.** Shape-Adaptive Geometric Simplification of Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova // International Journal of Geographical Information Science. — 2017. — Vol. 31. — № 8. — pp. 1485-1520.

Output typst:

#strong[Samsonov T.E.] Shape-Adaptive Geometric Simplification of Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova // International Journal of Geographical Information Science. — 2017. — Vol. 31. — № 8. — pp. 1485-1520.

Compiling Typst to PDF gives:

image

When applying this Lua filter:

return {
  {
    Str = function (elem)
      if elem.text == "//" then
        return pandoc.RawInline('typst', '\\/\\/')
      else
        return elem
      end
    end,
  }
}

Output Typst is

#strong[Samsonov T.E.] Shape-Adaptive Geometric Simplification of Heterogeneous Line Datasets / T. E. Samsonov, O. P. Yakimova \/\/ International Journal of Geographical Information Science. – 2017. – Т. 31. – № 8. – С. 1485-1520.

And the resulting PDF is okay:

image

Resume

Since // is not a comment in the input, it is expected that it remains so in the output. I suggest that Typst writer should escape double forward slashes in plain text.

Pandoc version?

pandoc 3.1.6
Features: +server +lua
Scripting engine: Lua 5.4
@tsamsonov tsamsonov added the bug label Jul 25, 2023
@jgm jgm closed this as completed in 77e0124 Jul 25, 2023
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

1 participant