Rendering issue when using build_article() and leaflet/tmap
I have an intermittent but reoccurring issue with pkgdown::build_articles() when trying to compile a vignette for a package.
As a reproducible example, I've uploaded a RMarkdown file to GitHub here along with the sf file (5.8mb).
The document renders fine with rmarkdown::render() but fails with pkgdown::build_articles() in that the process completes without errors but the resulting html fails for the map and all lines thereafter.
The problem occurs when using view mode on tmap:
tmap_mode("view") +
tm_shape(dfunitemethod) +
tm_lines()
and persists when the tmap object is converted to leaflet:
tmpplot <- [tm_shape](https://rdrr.io/pkg/tmap/man/tm_shape.html)(dfunitemethod) +
[tm_lines](https://rdrr.io/pkg/tmap/man/tm_lines.html)()
tmpplot_leaflet <- [tmap_leaflet](https://rdrr.io/pkg/tmap/man/tmap_leaflet.html)(tmpplot, mode = "view")
The page and map render fine with tmap_mode("plot") and rmarkdown::render().
The issue seems to occur with multilinestrings, and I've checked with st_is_valid(NA_on_exception = TRUE, reason = TRUE) that the geometries are valid. These are fairly large datasets (1k MULTILINESTRINGS), but the error hasn't occurred on larger datasets with polygons or points.
I've also tried adding options(htmltools.preserve.raw = FALSE) to the code chunk to see if this fixes the issue, but nothing so far.
Suggestions on where to begin would be very welcome
session info below:
R version 4.3.1 (2023-06-16) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Ventura 13.4, RStudio 2023.6.1.524
Locale: en_US.UTF-8 / en_US.UTF-8 / en_US.UTF-8 / C / en_US.UTF-8 / en_US.UTF-8
time zone: Australia/Brisbane tzcode source: internal
Package version:
base64enc_0.1.3 bslib_0.5.1 cachem_1.0.8 cli_3.6.1 digest_0.6.33 ellipsis_0.3.2 evaluate_0.21 fastmap_1.1.1 fontawesome_0.5.2 fs_1.6.3
glue_1.6.2 graphics_4.3.1 grDevices_4.3.1 highr_0.10 htmltools_0.5.6 jquerylib_0.1.4 jsonlite_1.8.7 knitr_1.43.15 lifecycle_1.0.3 magrittr_2.0.3
memoise_2.0.1 methods_4.3.1 mime_0.12 R6_2.5.1 rappdirs_0.3.3 rlang_1.1.1 rmarkdown_2.24 sass_0.4.7 stats_4.3.1 stringi_1.7.12
stringr_1.5.0 tinytex_0.46 tools_4.3.1 utils_4.3.1 vctrs_0.6.3 xfun_0.40 yaml_2.3.7
Pandoc version: 3.1.1