-
Notifications
You must be signed in to change notification settings - Fork 298
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
Certain urls get mangled when rendering with python kernel #10021
Comments
After a bit of tinkering, it feels like it has something to do with two hypens around a number, or something like that. This also gets mangled: |
The HTML produced is correct (from Pandoc and Quarto):
Now, if you open the HTML in a browser, the browser has issues. The whole issue is the unicode character in the URL. Screen.Recording.2024-06-15.at.19.50.57.movThat's not a Quarto issue/bug. |
@machow Could you have copied+pasted this URL somewhere, or maybe your text editor replaced the |
In any case, I think @mcanouil's diagnosis is correct, and this isn't a Quarto bug. I'm going to close this, but we should reopen if I'm wrong. |
Hello, I think the endash is an unfortunate misdirection. @mcanouil's response explains well how an endash might get handled. But it doesn't explain this:
How did things like the leading I think a important piece here is that I copied the link with the endash from the quartodoc interlinks filter log (while debugging), but the input in The endash comes from pandoc.utils.stringify?edit: wait, no it's there in the metadata before stringify is called. When I log the URL in a filter, the endash seems to be added by filter.lua function Meta(meta)
for k, v in pairs(meta.interlinks.sources) do
quarto.log.warning(v.url)
prefix = pandoc.utils.stringify(v.url)
quarto.log.warning(prefix)
end
end test.qmd
|
So, your URL comes from YAML. You see the transformation as endash with the below code. ---
format: html
value: https://xn--pr-350quartodoc-ju9h.netlify.app/api/Auto.html#quartodoc.Auto
---
{{< meta value >}} And if you don't want any markdown transformation: ---
format: html
value: "`https://xn--pr-350quartodoc-ju9h.netlify.app/api/Auto.html#quartodoc.Auto`{=html}"
---
{{< meta value >}} I am not sure Quarto can do something here. Maybe you could have a small Lua filter that ensure the YAML keys are treated as is. I don't how how Quarto treats URLs in YAML, but I think it's done via TypeScript and not Lua. |
I think this is a clear quarto issue and needs to be reopened. Either in terms of needing to communicate to people that URLs in edit: URLs are used frequently in quarto-web's edit2: to restate the second part of my concern. It's clear how an endash could mess things up. My concern was that...
Note that |
Please see my initial issue, which includes instructions to reproduce in a jupyter kernel (I suspect the engine is important? but could be wrong). |
FYI, for |
That's because the URL is not valid in the first place as it contains an endash. I'm really confused here.
|
Ahhh, this is so helpful, thanks! I didn't notice that in the source it's "okay", but has the mixed in characters when hovered over. I think it's just the issue of |
In your case, is it not possible to write a small LUA filter that adds the raw block/span code? Or that escape some characters as done in 6e5976f |
Ok:
|
The "Punycode" (i did not know the term) is the browser as the emitted HTML is fine, so Pandoc is only responsible for endash, emdash, etc. |
Maybe a more general fix would be as the one for |
OK. I'm going to close this and reopen an issue with a better repro. |
@cscheid the above shows the issue 😉 (in a new issue indeed) |
See #10042 |
Just want to add additional information on this. This is Pandoc. It has a
This extensions is activated by default and impact how things are written in output. HTML is among the format where en-dash are used
Note the two dashes without smart enabled. This all happens in the Markdown reader !
Why does it happens with metadata field ? Because they are parsed as Markdown values by Pandoc
We already had issues of this type in the past, and internally using the new
Hope it helps understand. I'll also post in the other issue. |
This occurred when running a jupyter kernel.
example.qmd
The link target becomes
https://xn--pr-350quartodoc-ju9h.netlify.app/api/Auto.html#quartodoc.Auto
.Here's a 1 minute screencast demo'ing: https://www.loom.com/share/ef148ccc145e482abb17c72d62ecd9aa
quarto version
Using quarto v1.5.45, but checked on several earlier versions of quarto also
quarto check
The text was updated successfully, but these errors were encountered: