The children of a nested HTML tag gets rendered as code instead of literal HTML when using prependContent() and saveWidget(..., selfcontained = T)
library(htmltools)
library(htmlwidgets)
one <- tags$div("Some text")
two <- tags$div(one)
p <- prependContent(leaflet::leaflet(), two)
saveWidget(p, "index.html")

Interestingly enough this same example works as expected when selfcontained = FALSE
saveWidget(p, "index.html", selfcontained = FALSE)
# this also works
p <- prependContent(leaflet::leaflet(), one)
saveWidget(p, "index.html")
So, perhaps this is a pandoc issue?