Skip to content

fix: do not autolink code that is in a link#2972

Open
maelle wants to merge 3 commits intomainfrom
untweak
Open

fix: do not autolink code that is in a link#2972
maelle wants to merge 3 commits intomainfrom
untweak

Conversation

@maelle
Copy link
Collaborator

@maelle maelle commented Feb 12, 2026

Currently, pkgdown autolink the text of href tags.

Example:
https://github.com/maelle/mcpackageface

  • has hello() and goodbye() functions.
  • the Rd page for goodbye() has \href{https://github.com}{\code{hello()}}
  • in the pkgdown reference page this becomes <a href="https://github.com" class="external-link"><code><a href="hello.html">hello()</a></code></a>.

This PR fixes this.


test_that("no autolink in href", {
expect_equal(
rd2html("\\href{https://example.com}{\\code{download.file()}}"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked that this fails on main 😸

@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant