Skip to content
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

Rd deparser has serious bugs in R < 4.3 #31

Merged
merged 2 commits into from
Nov 5, 2024
Merged

Conversation

aitap
Copy link
Contributor

@aitap aitap commented Sep 12, 2024

The package depends on as.character.Rd(deparse = TRUE) to work correctly. Prior to version 4.3.0, the deparser had serious bugs:

r"[\ifelse{latex}{\out{\\LaTeX}}{non-LaTeX}]" |>
 textConnection(name = 'foo') |>
 tools::parse_Rd(fragment = TRUE) |>
 as.character(deparse = TRUE) |>
 paste(collapse = '') |> cat()
# \ifelse{{latex}{\out{\\LaTeX}}{non-LaTeX}}

If the translator (or the user: both rely on rd_flattento_text) is running an LTS distro (Debian stable / Ubuntu 20.04 LTS, 22.04 LTS), their current version of R may be older than 4.3 (4.2.2, 3.6.3, 4.1.2, respectively). Let's mark the dependency of the package on the less buggy behaviour of the deparser, so that the translated Rd markup would not be invalid.

Previous versions of R had serious bugs in the Rd deparser, see
news(grepl('deparse.*LaTeX', Text)) and PR#18324.
@eliocamp
Copy link
Owner

eliocamp commented Nov 5, 2024

Thanks for the heads up.

@eliocamp eliocamp merged commit b447ca9 into eliocamp:main Nov 5, 2024
1 check failed
@aitap aitap deleted the depends_r43 branch November 5, 2024 17:43
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