-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
pandoc_self_contained_html() does not produce a valid HTML file #2087
Comments
I don't know why we were forcing the input format to be Lines 453 to 456 in a11240d
It seems to be more sensible to use html as the input format if the input file has the extension .html .
|
So looking at this function more closely, I think this is a very old function that does not do what the documentation said. It will only convert if the input is markdown and not html. This function is 7 years old, and did not change much since then (a tweak 5 years ago). it seems it was made to convert from I don't really know what this function was for at the time. From a quick search, it seems this function was used in RStudio IDE but it has been internalized since 1.1 There is now a comment there that gives us some hints:
So it seems at the time, using If we dig more, it seems that some fixes have been done in the RStudio version, specifically for the issue in #2066 (fixed by rstudio/rstudio#1756). Last version is here: https://github.com/rstudio/rstudio/blob/master/src/cpp/session/modules/ModuleTools.R#L375
The rmarkdown version of It is possible the this current function is no more used - maybe it would be better to deprecate it and work on a new function that does correctly was we want it to do. (Convert HTML content to a self contained version ?) The minimum we could do is port the fix that are in the other packages for making a working version. But is rmarkdown the right place for this function ? Fun history research - thanks @RLesur ! Regarding your usage in your project, I believe to create a HTML file for a HTMLwidget, I believe |
Thanks @cderv for this archivist's work! This was the first time I tried to use |
I also found that this function was not used anywhere in this package. I'm okay with deprecating it and removing it in a future version of rmarkdown. |
Just stumbled over this issue - Which
There is a similar situation regarding
|
Possibly this future change would help us rework this function: #2382 |
Hi,
I got the same bug as in #2066: the HTML file produced with
pandoc_self_contained_html()
is invalid (it begins with an openingp
tag).Here's a reprex:
Created on 2021-04-01 by the reprex package (v1.0.0)
If you are interested in, I wrote an alternative version here.
By filing an issue to this repo, I promise that
xfun::session_info('rmarkdown')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rmarkdown')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: