Skip to content

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

Merged
cderv merged 4 commits intomainfrom
fix-2534
Jan 18, 2024
Merged

Correctly avoid writing to the input file when there are no preserved HTML chunks#2535
cderv merged 4 commits intomainfrom
fix-2534

Conversation

@yihui
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

yihui commented Jan 17, 2024

@cderv The withr issue is gone now.

@J-Moravec Thanks for adding the test!

@J-Moravec
Copy link
Copy Markdown
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
Copy Markdown
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
@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