Skip to content

Comments

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

Merged
maelle merged 3 commits intomainfrom
untweak
Feb 17, 2026
Merged

fix: do not autolink code that is in a link#2972
maelle merged 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

Copy link
Collaborator

@jayhesselberth jayhesselberth left a comment

Choose a reason for hiding this comment

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

LGTM!

@maelle maelle merged commit f3ec6e2 into main Feb 17, 2026
17 checks passed
@maelle maelle deleted the untweak branch February 17, 2026 08:47
@maelle
Copy link
Collaborator Author

maelle commented Feb 17, 2026

Thanks @jayhesselberth!

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.

2 participants