jimhester / knitrBootstrap

A framework to create bootstrap styled HTML reports from knitr Rmarkdown.
Other
274 stars 61 forks source link

kable output broken in recent versions of rmarkdown #70

Closed khughitt closed 9 years ago

khughitt commented 9 years ago

Hi Jim,

Starting recently, I noticed that the output from the knitr kable function is not being handled well. What appears to be happening is the HTML which is appended after the output follows too soon and bleeds into the table.

Manually added newlines after the kable call does not fix the issue.

It's possible that this is an issue for rmarkdown, but I cannot be certain and the kable output for normal html_document renderings looks okay.

In either case, the fix should be as simple as adding a newline somewhere in the output.

To reproduce the issue, try:

test.rmd

    ---
    output:
      knitrBootstrap::bootstrap_document:
        title: "Test"
    ---
    ```{r, results='asis'}
    library(knitr)
    library(MASS)
    kable(iris)

**run:**

library(rmarkdown) library(knitrBootstrap) render('test_kable.rmd', clean=FALSE)


Here is an example from the markdown where the problem is occurring:

... 6.3 2.5 5.0 1.9 virginica
6.5 3.0 5.2 2.0 virginica
6.2 3.4 5.4 2.3 virginica
5.9 3.0 5.1 1.8 virginica

jimhester commented 9 years ago

I think this is actually a kable bug, it should output an extra newline after the table, I will submit a pull request.

jimhester commented 9 years ago

Keith,

I tracked this but down and submitted a pull request to knitr, once it gets merged I will close this pull. Thank you for debugging the issue and the pull request, you made easy to figure out what was going on!

khughitt commented 9 years ago

Sure thing! Thanks for the quick upstream fix!