quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.91k stars 322 forks source link

blog output: tag links don't work from pages called with an anchor URL #10710

Closed aborruso closed 1 month ago

aborruso commented 1 month ago

Bug description

If I open this URL this URL that contains an anchor

https://quarto.org/docs/blog/posts/2024-07-02-beautiful-tables-in-typst/#cars-heatmap-gt-r

the links of the page tags does not work, the links are not active

image

Steps to reproduce

Expected behavior

To have the tag links work

Actual behavior

The tag links not work

Your environment

The env used for quarto website

Quarto check output

The output of quarto website

mcanouil commented 1 month ago

The output of quarto website

That is not the output of quarto check Could you provide the quarto check output as requested in the template?

The env used for quarto website

That is not your environment. Please do read properly the issue template. We expect your environment such as your operating system, etc.

aborruso commented 1 month ago

@mcanouil I reproduced the user experience, it is the blog of the repository of the quarto official website. For this reason I did not include what was requested in the template.

This is the repo https://github.com/quarto-dev/quarto-web

Should I download the repo locally, render and see if it doesn't work locally by me as well? I don't think so, I think what you see online may be enough.

Thank you always

mcanouil commented 1 month ago

It's not about the reproducible example or not really. It's really about your environment which is not the one used for Quarto website. And we have no idea which Quarto and dependencies you are using.

mcanouil commented 1 month ago

It seems you are commenting on a rendered page, but did you reproduce the error? Possibly with a simple example rather that a website/repository as big as Quarto documentation.

FYI, I do reproduce the website issue, including prelease. https://prerelease.quarto.org/docs/blog/posts/2024-07-02-beautiful-tables-in-typst/#cars-heatmap-gt-r

aborruso commented 1 month ago

Thank you, I close it and open again in the repo of website

cderv commented 1 month ago

This is fine here. Let's not duplicate on the other side.

cderv commented 1 month ago

Problem is in quarto.js. The link processing does not account for anchor part in url https://github.com/quarto-dev/quarto-cli/blob/962c77e8a56932567360dd3f17a27b81ea12f501/src/resources/formats/html/quarto.js#L227-L260

We'll fix this.

mcanouil commented 1 month ago

Thank you, I close it and open again in the repo of website

That's not what I meant. I meant you seem to report an issue on the website that you did not reproduce using a simple reproducible example with Quarto CLI.

aborruso commented 1 month ago

@cderv I also seemed fine here.It was a special case in my opinion, well described, so it didn't make sense to put those two parts of the template. But maybe I'm wrong.

Anyway, thank you very much to you and @mcanouil

aborruso commented 1 month ago

And I'm glad I was helpful. Unfortunately, I don't know how to correct the code

cderv commented 1 month ago

Yes thanks for the report. We'll handle it from here.

It was a special case in my opinion, well described, so it didn't make sense to put those two parts of the template. But maybe I'm wrong.

FWIW I agree with you, it was descriptive enough and reproducible with the website so we can find the issue. This is special case is usually true for JS code part that runs in browser. If is applies on website, then it will most of the time impact our quarto website.

Thank you, this is enough for me to go fix this.