diff --git a/DESCRIPTION b/DESCRIPTION index b351259f..381085bd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: htmltools Title: Tools for HTML -Version: 0.5.8.9000 +Version: 0.5.9 Authors@R: c( person("Joe", "Cheng", , "joe@posit.co", role = "aut"), person("Carson", "Sievert", , "carson@posit.co", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index d3e54cdf..c310a6f4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# htmltools (development version) +# htmltools 0.5.9 * Fix test for testthat 3.3.0. (#442) diff --git a/README.md b/README.md index a38aeb4a..06624d01 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ remotes::install_github("rstudio/htmltools") [This Shiny article](https://shiny.posit.co/articles/html-tags.html) provides a great introduction to `{htmltools}` (even if you're not interested in Shiny). As you'll learn in that article, the general foundation that `{htmltools}` provides allows other R packages (e.g., [`{htmlwidgets}`](http://www.htmlwidgets.org/), [`{crosstalk}`](https://rstudio.github.io/crosstalk/), etc.) to provide "HTML components" in R that users can manipulate and combine in ways the component authors didn't foresee. -For example, as described in depth [here](https://plotly-r.com/arranging-views.html#arranging-htmlwidgets), `{htmltools}` makes it fairly easy to arrange numerous `{htmlwidgets}` (e.g., `{plotly}` graphs) into a single static HTML webpage: +For example, as described in depth [here](https://plotly-book.netlify.app/arranging-views.html#arranging-htmlwidgets), `{htmltools}` makes it fairly easy to arrange numerous `{htmlwidgets}` (e.g., `{plotly}` graphs) into a single static HTML webpage: ```r library(htmltools) diff --git a/src/template.c b/src/template.c index 4269b388..d25e0017 100644 --- a/src/template.c +++ b/src/template.c @@ -199,10 +199,8 @@ SEXP template_dfa(SEXP x_sxp) { UNPROTECT(1); if (pieces_num < Rf_xlength(pieces)) { - // Using SETLENGTH and SET_TRUELENGTH in this way allows us to resize the - // vector without an extra copy. - SETLENGTH(pieces, pieces_num); - SET_TRUELENGTH(pieces, pieces_num); + // Resize the vector to the actual number of pieces + REPROTECT(pieces = Rf_xlengthgets(pieces, pieces_num), pieces_idx); } UNPROTECT(1);