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

make sure to avoid creating invalid paths when copying resources #2429

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

mnazarov
Copy link
Contributor

This is to address quite a specific use-case:

Running a rmarkdown document with runtime: shiny using a custom output format that includes some resources (e.g. logo or css) from an absolute path - which common if they are coming from a system.file call.

When runtime:shiny is used the render is called with explicit copy_resources = TRUE which then calls copy_resources. Currently it just appends the path to the ..._files folder:

  • On *nix absolute path starts with / so the final url becomes e.g. ..._files//home/... which is not too bad, but still not recommended
  • On windows the path becomes ..._files/C:/... which is invalid

Copy link
Member

@yihui yihui left a comment

Choose a reason for hiding this comment

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

Thanks! Could you also add a brief news item to NEWS.md?

R/html_resource_copy.R Outdated Show resolved Hide resolved
@yihui yihui merged commit 50e0f97 into rstudio:main Jan 17, 2023
@mnazarov
Copy link
Contributor Author

thanks! sorry I missed your comment about news

@yihui
Copy link
Member

yihui commented Jan 18, 2023

No worries!

jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Jan 20, 2023
Merge remote-tracking branch 'rstudio/main' into jg-devel

# By Yihui Xie (3) and others
# Via Yihui Xie
* rstudio/main:
  start the next version
  CRAN release v2.20
  make sure `ioslides_presentation` is properly self-contained when requested (rstudio#2428)
  More tests needs fixing
  Newer Pandoc (currently devel) fixes GFM toc previously written in HTML instead of Markdown
  make sure to avoid creating invalid paths when copying resources (rstudio#2429)
  Fix rstudio#1508: do not resolve input files that are symlinks (rstudio#2438)

# Conflicts:
#	DESCRIPTION
jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Jan 20, 2023
* rstudio/main:
  start the next version
  CRAN release v2.20
  make sure `ioslides_presentation` is properly self-contained when requested (rstudio#2428)
  More tests needs fixing
  Newer Pandoc (currently devel) fixes GFM toc previously written in HTML instead of Markdown
  make sure to avoid creating invalid paths when copying resources (rstudio#2429)
  Fix rstudio#1508: do not resolve input files that are symlinks (rstudio#2438)
jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Mar 20, 2023
* jg-devel:
  Use the `fontawesome` package for the HTML dependency on Font Awesome (rstudio#2451)
  Ensure that rmarkdown::reneder() always returns invisibly (rstudio#2452)
  use knitr::is_latex_output() in case the output format name contains Pandoc extensions, e.g., `latex-smart`
  start the next version
  CRAN release v2.20
  make sure `ioslides_presentation` is properly self-contained when requested (rstudio#2428)
  More tests needs fixing
  Newer Pandoc (currently devel) fixes GFM toc previously written in HTML instead of Markdown
  make sure to avoid creating invalid paths when copying resources (rstudio#2429)
  Fix rstudio#1508: do not resolve input files that are symlinks (rstudio#2438)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants