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

Fix regression w/ image path processing from absolute to relative #2554

Merged
merged 3 commits into from
Apr 30, 2024

Conversation

cderv
Copy link
Collaborator

@cderv cderv commented Apr 30, 2024

Processing of HTML needs to account for newlines because pandoc --wrap behavior can sometimes likes to split lines in the HTML like

<img>
src="..." </img>

Processing line by line would break a reg for img tag's src attribute

This breakage was found in pkgdown processing which uses absolute path for rendering leading to very long image source creating the split

It is also related to knitr.graphics.rel_path = FALSE being set fro

Related to

See discussion in 0951a2f

cderv added 2 commits April 30, 2024 11:40
Processing of HTML needs to account for newlines because pandoc --wrap behavior can sometimes likes to split lines in the HTML like
```
<img>
src="..." </img>
```

Processing line by line would break a reg for img tag's src attribute

This breakage was found in pkgdown processing which uses absolute path for rendering leading to very long image source creating the split
- For generic case with plot
- With a specific case of pandoc markdown syntax + absolute path

This adds xml2 as suggest for testing
@cderv cderv changed the title Revert 0951a2f Fix regression regarding image path processing from absolute to relative Apr 30, 2024
@cderv cderv requested a review from yihui April 30, 2024 14:57
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!

@cderv cderv changed the title Fix regression regarding image path processing from absolute to relative Fix regression w/ image path processing from absolute to relative Apr 30, 2024
@cderv cderv merged commit eecb5f4 into main Apr 30, 2024
18 checks passed
@cderv cderv deleted the fix/html-postprocess-image branch April 30, 2024 15:47
@yihui
Copy link
Member

yihui commented Apr 30, 2024

It has been almost two months since the last release, so we can plan for a new CRAN release soon (depending on whether we have other stuff that should go with this release).

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

# By Yihui Xie (10) and others
# Via GitHub
* rstudio/main:
  Fix Pandoc nightly install in GHA (rstudio#2559)
  feat(beamer): support latex_dependencies (rstudio#2558)
  start the next version
  CRAN release 2.27
  export S3 method
  rsconnect::deploySite() has combined the arguments account and server in the doc
  Update forum url (rstudio#2555)
  Fix regression w/ image path processing from absolute to relative (rstudio#2554)
  Update posit forum URL
  provide an option to set the `*_files/` directory suffix (rstudio#2550)
  start the next version
  CRAN release v2.26
  use _PACKAGE as recommended by roxygen2
  use \describe{} instead of \itemize{} (r-devel will warn against it)
  [GHA] Remove duplicate entry in matrix
  new r-lib/actions@v2 has newer setup-pandoc
  [GHA] New setup pandoc action (rstudio#2543)
  Correctly avoid writing to the input file when there are no preserved HTML chunks (rstudio#2535)
  Create FUNDING.yml
  Fix small grammatical error (rstudio#2533)

# Conflicts:
#	DESCRIPTION
#	R/publish_site.R
jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Aug 8, 2024
* jg-devel: (21 commits)
  Builds and passes R CMD CHECK.
  Fix Pandoc nightly install in GHA (rstudio#2559)
  feat(beamer): support latex_dependencies (rstudio#2558)
  start the next version
  CRAN release 2.27
  export S3 method
  rsconnect::deploySite() has combined the arguments account and server in the doc
  Update forum url (rstudio#2555)
  Fix regression w/ image path processing from absolute to relative (rstudio#2554)
  Update posit forum URL
  provide an option to set the `*_files/` directory suffix (rstudio#2550)
  start the next version
  CRAN release v2.26
  use _PACKAGE as recommended by roxygen2
  use \describe{} instead of \itemize{} (r-devel will warn against it)
  [GHA] Remove duplicate entry in matrix
  new r-lib/actions@v2 has newer setup-pandoc
  [GHA] New setup pandoc action (rstudio#2543)
  Correctly avoid writing to the input file when there are no preserved HTML chunks (rstudio#2535)
  Create FUNDING.yml
  ...
jonathan-g added a commit to jonathan-g/rmarkdown that referenced this pull request Aug 8, 2024
* rstudio/main:
  Fix Pandoc nightly install in GHA (rstudio#2559)
  feat(beamer): support latex_dependencies (rstudio#2558)
  start the next version
  CRAN release 2.27
  export S3 method
  rsconnect::deploySite() has combined the arguments account and server in the doc
  Update forum url (rstudio#2555)
  Fix regression w/ image path processing from absolute to relative (rstudio#2554)
  Update posit forum URL
  provide an option to set the `*_files/` directory suffix (rstudio#2550)
  start the next version
  CRAN release v2.26
  use _PACKAGE as recommended by roxygen2
  use \describe{} instead of \itemize{} (r-devel will warn against it)
  [GHA] Remove duplicate entry in matrix
  new r-lib/actions@v2 has newer setup-pandoc
  [GHA] New setup pandoc action (rstudio#2543)
  Correctly avoid writing to the input file when there are no preserved HTML chunks (rstudio#2535)
  Create FUNDING.yml
  Fix small grammatical error (rstudio#2533)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2024
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