Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
it's unlikely for an img src to contain line breaks, so it shouldn't be necessary to one_string(html) beforehand and split it afterwards
- Loading branch information
0951a2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yihui I believe this breaks some edge cases where the HTML contains
<img
andsrc=
on separate linesFor example, it prevents some absolute links to be made relative the
html_document_base
processing.Took me a while to come to here, but I believe this is why this
one_string
calls was there - to avoid dealing with new lines like this.I think what is causing the issue is the pandoc 2.17 change in
--wrap=auto
being the default for HTML which creates this wrapping whensrc=
is very very long.It happens with
knitr::include_graphics()
usage or any other that will write the![](very/long/path.qmd)
So either we do something about
--wrap
, or we revert this change not doing aone_string
0951a2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about the oversight!
I'm okay with either solution. The latter may be safer, though. Do you want me to do it or you can go ahead and do it? I think it should be two lines of code.
0951a2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do it. By the way, this goes with a second issue in
knitr::include_graphics()
where the absolute path is not computed usingoutput.dir=
from rmarkdown but usingknitr
output.dir
option which is different.fig_path
will be computed to be output directory as set by R Markdown, but if someone like magick or gganimate creates image infig_path
and then attached usinginclude_graphics()
- the wrong relative path is computed.I'll try to open an issue but this is related to yihui/knitr#2171 IMO. We can discuss live too