title: Header syntax does not start newline after mainPanel
body: <p>I am trying to learn how to create R Markdown documents containing Shiny elements. </p>
  
  <p>I ended up having a problem that header syntax <code>##</code> does not create a new line before the header, instead, the header is shown right to the previous <code>mainPanel</code> element. Below is shown the resulting image:</p>
  
  <p><a href="https://i.stack.imgur.com/oqAaH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oqAaH.png" alt="enter image description here"></a></p>
  
  <p>and here is code which generates the situation:</p>
  
  <pre><code>---
  output: html_document
  runtime: shiny
  ---
  
  ```{r setup, include=FALSE}
  knitr::opts_chunk$set(echo = TRUE)
  ```
  
  ```{r pressure, echo=FALSE}
  mainPanel(plotOutput("plot"))
  
  output$plot &lt;- renderPlot({
    plot(pressure)
  })
  ```
  
  ## Next header
  
  Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
  </code></pre>
  
  <p>What should I do in order to ensure that the header starts with a new line? </p>