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

<-> doesn't show up in rendered sites #2286

Closed
DavisVaughan opened this issue Mar 6, 2023 · 2 comments · Fixed by #2471
Closed

<-> doesn't show up in rendered sites #2286

DavisVaughan opened this issue Mar 6, 2023 · 2 comments · Fixed by #2471
Labels
bug an unexpected problem or unintended behavior front end 🌷 General HTML, CSS, and JS issues
Milestone

Comments

@DavisVaughan
Copy link
Member

Reported here
tidyverse/dplyr#6769

Where you can see that the dplyr pkgdown site has a vignette title like dplyr <-> base R but the <-> doesn't show up on the rendered page. It does seem to show up when looking at the title of the article in the nav bar though.

I think I'm remembering that <-> is some kind of comment in HTML? So maybe this can't be worked around? But it would be good to confirm

@maelle
Copy link
Collaborator

maelle commented Mar 20, 2023

Fun edge case. 😅

The problem happens at this stage

render_page(pkg, name, data, path, depth = depth, quiet = TRUE)

What works

  • changing {{{pagetitle}}} to {{pagetitle}} but I tried it randomly so probably not a good solution.
  • adding data[["pagetitle"]] <- escape_html(data[["pagetitle"]]). That sounds more promising, and might need to be applied in more places. I don't have time to explore more right now, sorry.

In the meantime you could add escaping in your vignette source, but then if escaping is added to pkgdown later, your title would be completely garbled.

@maelle maelle added the bug an unexpected problem or unintended behavior label Jun 9, 2023
@hadley hadley added the front end 🌷 General HTML, CSS, and JS issues label Apr 12, 2024
@hadley hadley added this to the 2.1.0 milestone Apr 12, 2024
@hadley
Copy link
Member

hadley commented Apr 18, 2024

I reviewed all the places we set the pagetitle and they all seem to be raw text. Even for reference topics which already does paste0(strip_html_tags(out$title), " \u2014 ", out$name). So I think the right move is to escape in the template.

hadley added a commit that referenced this issue Apr 18, 2024
hadley added a commit that referenced this issue Apr 23, 2024
SebKrantz pushed a commit to SebKrantz/pkgdown that referenced this issue Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior front end 🌷 General HTML, CSS, and JS issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants