Skip to content

Conversation

@maelle
Copy link
Collaborator

@maelle maelle commented Oct 13, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

@maelle
Copy link
Collaborator Author

maelle commented Oct 13, 2025

@maelle maelle requested a review from hadley October 13, 2025 10:02
# Fix seealso links
seealso_links <- xml2::xml_find_all(
html,
"//code[a and normalize-space(text()) = '()']"
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure you need the normalize-space here? I would think that it would be pretty unusually to have extra whitespace here.

maelle and others added 3 commits October 16, 2025 10:53
Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
@maelle maelle requested a review from hadley October 16, 2025 09:00

tweak_anchors(html)
tweak_link_md(html)
tweak_link_seealso(html)
Copy link
Member

Choose a reason for hiding this comment

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

I think it's slightly better for this to live with the other link tweakers?

html <- xml2::read_html('<code><a>build_site</a>()</code>')
tweak_link_seealso(html)

expect_equal(xpath_contents(html, ".//code"), "<a>build_site()</a>")
Copy link
Member

Choose a reason for hiding this comment

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

Main thing here is to use new xpath_contents() helper which makes testing a bit nicer.

@hadley hadley merged commit 782d4e2 into main Oct 17, 2025
15 checks passed
@hadley hadley deleted the seealso branch October 17, 2025 18:29
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.

3 participants