Problem with map "titles" in interactive mode in knitted Markdown to html
Hi,
I am encountering a problem while trying to knit a rmarkdown including interactive tmap maps to html. In practice, if I include multiple r chunks including faceted maps, the "titles" on the top left corner are somehow "collated" in the maps of the first chunk, as in the picture below.

Generated with the Rmd in attach:
Note that all seems to work properly if I use tmap_mode("plot"). I am also reasonably sure that it was working properly some versions ago, but unfortunately can not be more specific.
On a side note: Is there any way to manually set the "legend names" in the different facets? They seem to originate from the "names" attribute of the input stars object. However, sometimes it could be useful to set them manually (for example, to plot different bands of a "RasterStack" object containing different variables, which therefore have different measurement units/legends).
I think that before the "switch" to stars use, the legend names where originated based on the names attributes of the rasterStack, and therefore could "vary" with band.
Thanks in advance,
Lorenzo
Note that this is not specific to facets.
Here is a simpler example with two single maps, trying to make it as minimal as possible (source .Rmd and output .html in zip archive).

In the HTML, the second script (for the second map widget) contains this extra bit:
"jsHooks": {
"render": [{
"code": "function(el, x, data) {\n return (\n\t\t\t\t\t\tfunction(el, x) {\n\t\t\t\t\t\t\tvar tldiv = document.getElementsByClassName(\"leaflet-top leaflet-left\")[0];\n\t\t\t\t\t\t\tvar titlediv = document.createElement('div');\n\t\t\t\t\t\t\ttitlediv.className = \"info legend leaflet-control\";\n\t\t\t\t\t\t\ttitlediv.innerHTML = \"<b>A Title<\/b>\";\n\t\t\t\t\t\t\ttldiv.insertBefore(titlediv, tldiv.childNodes[0]);\n\t\t\t\t\t\t}).call(this.getMap(), el, x, data);\n}",
"data": null
}]
}
How come this ends up applying to the previous widget?
Did you manage to resolve this?