-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
renderText ejects header class into document #133
Comments
I believe that this will be addressed by this shiny PR: rstudio/shiny#512 @yihui is that correct? If so I'll close this issue here. |
That PR only addresses part of this issue. It uses I tried to debug this problem, but did not succeed. It seems Pandoc was confused by the HTML tag in
Note it works when renderText() is in a paragraph. I guess the problem is related to |
+1 to the original problem, it would be nice to be able to have dynamic text in headers. Please, fix :) |
This problem turns out to be a little tricky. I have found out the reason but do not know how to fix it. We probably need @jcheng5's input here, since it is an issue caused by abc
## `r renderText('foo')`
def The HTML output from shiny in Markdown is first "preserved" like this: abc
## <!--html_preserve--><span id="a" class="b">foo</span><!--/html_preserve-->
def Then the preserved chunk is replaced by a random ID (here abc
## preserveRandomID
def The Markdown document is passed to Pandoc now, and turned to HTML: <p>abc</p>
<div id="preserveRandomID" class="section level2">
<h2>preserveRandomID</h2>
<p>def</p>
</div> Note the section is wrapped in a div with an id <p>abc</p>
<div id="<!--html_preserve--><span id="a" class="b">foo</span><!--/html_preserve-->" class="section level2">
<h2><!--html_preserve--><span id="a" class="b">foo</span><!--/html_preserve--></h2>
<p>def</p>
</div> Only the second One possible solution that I can think of is to use <p>abc</p>
<div id="preserveRandomID" class="section level2">
<h2><span>preserveRandomID</span></h2>
<p>def</p>
</div> Then we restore |
Meanwhile, I found a workaround. Instead of making pandoc generate value for
This way Relevant section in pandoc: http://johnmacfarlane.net/pandoc/README.html#header-identifiers-in-html-latex-and-context |
@elephantum Oh nice trick. Thanks! |
Another way would be to turn off |
This will be fixed by #1131. |
Fix #133: remove the id of the preserved HTML chunk when it is in a section id attribute
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. |
When I place reactive text into a header, it appears and reactivity works. However, part of the html also appears in the document, which looks bad.
For example, this .Rmd file
renders as
The text was updated successfully, but these errors were encountered: