-
Notifications
You must be signed in to change notification settings - Fork 337
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
Incorrect rendering of comparison generics <
, >
, etc.
#2303
Comments
Thanks for reporting! I don't have time to investigate right now but it looks related to #2286 |
It's already using |
Ok, at least two problems here:
And there's yet another bug in the way we're detecting whether or not a function is infix. |
Ok, the root problem is that the Rd looks like this:
and we want to generate a usage like this: # S4 method for MyType,numeric
e1 < e2 In particular, note that It looks like base R effectively uses a hand-rolled tokeniser to solve this problem so we'll need to implement something similar in pkgdown. A couple of test cases for when I take a stab at this: test_that("infix methods parsed correctly", {
out <- rd2html("\\S3method{<}{foo}(x, y)")
expect_equal(out[[2]], "x < y")
out <- rd2html("\\S4method{<}{foo}(x, y)")
expect_equal(out[[2]], "x < y")
}) |
<
, >
, etc.<
, >
, etc.
The usage section of the html docs for S4 method implementations of comparison generics incorrectly renders
<
and>
with<
and>
Minimal reproducible package example here: https://github.com/bnprks/pkgdownbug (incorrectly rendered reference here)
An R file with text:
gets a usage section rendered to html as follows:
The text was updated successfully, but these errors were encountered: