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

Correctly avoid writing to the input file when there are no preserved HTML chunks #2535

Merged
merged 4 commits into from
Jan 18, 2024

Conversation

yihui
Copy link
Member

@yihui yihui commented Jan 17, 2024

Fix #2534: htmltools::extractPreserveChunks() will collapse the input character vector: https://github.com/rstudio/htmltools/blob/a8a3559edbfd9dda78418251e69273fa9dfeb9bc/R/tags.R#L1581-L1583 so we need to compare the collapsed version vs the extracted value later in identical().

@yihui
Copy link
Member Author

yihui commented Jan 17, 2024

The GHA failures seem to be due to the withr binary package.

@yihui yihui requested a review from cderv January 17, 2024 19:21
@cderv
Copy link
Collaborator

cderv commented Jan 17, 2024

I'll have a look - withr 3.0.0 was just release yesterday - so maybe some issues with the binary available for installation 🤔

@J-Moravec
Copy link
Contributor

Created a unit-test with an example code that triggered the error. Unfortunately, since I don't have write access, this is now in a new pull request:

#2536

@yihui
Copy link
Member Author

yihui commented Jan 17, 2024

@cderv The withr issue is gone now.

@J-Moravec Thanks for adding the test!

@J-Moravec
Copy link
Contributor

Thanks for a quick fix and for creating many packages that hugely improved the replicability not just in science @yihui !

@yihui yihui changed the title Correctly avoid writing to the input file when there are no preserved chunks Correctly avoid writing to the input file when there are no preserved HTML chunks Jan 18, 2024
Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

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

Looks good!

@cderv cderv merged commit 07e2a99 into main Jan 18, 2024
17 checks passed
@cderv cderv deleted the fix-2534 branch January 18, 2024 09:23
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rmarkdown::render() corrupts input file
3 participants