Skip to content
New issue

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

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

Already on GitHub? # to your account

Malformed url when converting from markdown to typst #8931

Closed
FirelightFlagboy opened this issue Jun 30, 2023 · 4 comments
Closed

Malformed url when converting from markdown to typst #8931

FirelightFlagboy opened this issue Jun 30, 2023 · 4 comments
Labels

Comments

@FirelightFlagboy
Copy link

Explain the problem.

I have the following input markdown that I want to convert to typst format.

<https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/Scille/parsec-cloud>

To convert to typst, I use the following command

pandoc --from=markdown --to=typst test.md --output=test.typ

And got the following output test.typ

#link("https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/Scille/parsec-cloud")[https://archive.softwareheritage.org/browse/origin/directory/?origin\_url\=https://github.com/Scille/parsec-cloud]

The issue I'm having, is the actual link is malformed:

The link has \ put in front of _url and =https(...) resulting in the link being broken

Below is the expected link (compared to the generated one)

- https://archive.softwareheritage.org/browse/origin/directory/?origin\_url\=https://github.com/Scille/parsec-cloud
+ https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/Scille/parsec-cloud

Pandoc version?

I'm using pandoc on Linux Alpine.

pandoc 3.1.4
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /.local/share/pandoc
Copyright (C) 2006-2023 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.
@jgm
Copy link
Owner

jgm commented Jun 30, 2023

I don't see the problem. The backslash-escapes are in the content part of the link, not the part that specifies the URL to be followed. And there they are harmless. I tried it it typst.app and the link appears and works correctly.

@FirelightFlagboy
Copy link
Author

They don't work on my side with the generate PDF 🥲

But by applying the modification above (removing the added \) the link work

@jgm
Copy link
Owner

jgm commented Jun 30, 2023

I can confirm that

  • it works (with the backslashes) in the preview pane of the app
  • it doesn't work in the exported PDF

That seems like a bug in typst to me. It should work the same in both, and the backslash should be harmless in this context. I would suggest reporting this to typst.

@jgm
Copy link
Owner

jgm commented Jun 30, 2023

I think that better output for pandoc to produce would be simply:

#link("https://archive.softwareheritage.org/browse/origin/directory/?origin_url=https://github.com/Scille/parsec-cloud")

When the content is not given, it defaults to the URL.
So I'll consider this a request for that output.

@jgm jgm closed this as completed in 284eb37 Jun 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants