You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
shinyrmd needs additional empty lines between content and knit meta #2336
If a shiny prerendered or shinyrmd source .Rmd ends with a single newline, the additional content added to support the prerendered format are added immediately after the content. This breaks pandoc's handling of the last line, e.g. it won't be processed into a paragraph tag.
Source
---title: "shinyrmd issue"output:
html_document:
keep_md: trueruntime: shinyrmd---
Here's some standard content, notice only one final empty line in the source file.
Edit: it seems that GitHub formatting removes the trailing empty line of the code block above. It's important that there is only one (or no) final empty line in the source file.
Markdown
---title: "shinyrmd issue"output:
html_document:
keep_md: trueruntime: shinyrmd---
Here's some standard content, notice only one final empty line in the source file.
<!--html_preserve-->
<scripttype="application/shiny-prerendered"data-context="dependencies">
<!--... inline json and other things ...-->
HTML
<!-- ... truncated ... -->
Here’s some standard content, notice only one final empty line in the
source file. <!--html_preserve--><scripttype="application/shiny-prerendered" data-context="dependencies">
<!-- ... inline json and other things ... -->
If only one more line were added at the end of the Rmd source file, we'd have this HTML:
<!-- ... truncated ... --><p>Here’s some standard content, notice only one final empty line in the
source file.</p><!--html_preserve--><scripttype="application/shiny-prerendered" data-context="dependencies">
<!-- ... inline json and other things ... -->
Thanks. That is quite a specific issue ! Indeed Pandoc won't see that as a paragraph. I guess adding a blank line before inserting the preserve part should be enough.
I noticed that we are still using <!--html_preserve--> keyword. I wonder if we should switch to using Pandoc's raw block but I guess there is no need and too many risk to break something 😄
Activity
cderv commentedon Mar 22, 2022
Thanks. That is quite a specific issue ! Indeed Pandoc won't see that as a paragraph. I guess adding a blank line before inserting the preserve part should be enough.
I noticed that we are still using
<!--html_preserve-->keyword. I wonder if we should switch to using Pandoc's raw block but I guess there is no need and too many risk to break something 😄Curious how did you found this one ! 😅
Add an empty line before adding any shiny prerendered context script …
github-actions commentedon Sep 20, 2022
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.