-
Notifications
You must be signed in to change notification settings - Fork 341
feat: put parentheses inside seealso links #2922
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
Conversation
R/tweak-reference.R
Outdated
| # Fix seealso links | ||
| seealso_links <- xml2::xml_find_all( | ||
| html, | ||
| "//code[a and normalize-space(text()) = '()']" |
There was a problem hiding this comment.
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.
Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
Co-authored-by: Hadley Wickham <h.wickham@gmail.com>
|
|
||
| tweak_anchors(html) | ||
| tweak_link_md(html) | ||
| tweak_link_seealso(html) |
There was a problem hiding this comment.
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>") |
There was a problem hiding this comment.
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.
No description provided.