Releases: rstudio/htmltools
htmltools 0.5.8
Improvements
-
The fill CSS attached to fillable containers and fill items with
bindFillRole()
now uses a CSS cascade layer namedhtmltools
to reduce the precedence order of the fill CSS. (#425) -
Improved documentation for boolean attributes in
tagAppendAttributes()
to note that they can be set via anNA
value, e.g.tagAppendAttributes(div(), contenteditable = NA)
creates<div contenteditable></div>
. (thanks @russHyde, #427)
Bug fixes
bindFillRole()
now attaches itsHTMLDependency()
to fill items, thus reducing the possibility of filling layout breaking due to missing CSS. (#421)
htmltools 0.5.7
New Features
save_html()
is now an S3 generic, allowing for more customization over how certain classes are saved to an HTML file. (#411)
Improvements
-
Fill items no longer set
overflow: auto
orwidth: 100%
by default. (#401) -
css()
now fully supports setting custom CSS properties (or CSS variables) via inline styles. When the name of a value passed tocss()
starts with--
, it will be treated as a custom CSS property and absolutely no changes will be made to the variable. For example,css("--font_size" = "3em")
returns--font_size:3em;
whilecss(font_size = "3em")
will returnfont-size:3em
. (#402)
Bug fixes
{htmltools}
now requires{rlang}
version 1.0.0 or higher. (#403)
htmltools 0.5.6.1
Improvements
tagQuery()
no longer throws an error when attempting to traverse a NULL value with r-devel. (#407)
htmltools 0.5.6
Possibly breaking changes
-
Closed #386: Fillable containers no longer set
overflow: auto
by default. Instead, they setmin-width
andmin-height
to0
to ensure that fill items a constrained in the fillable container without clipping their direct children. (#387) -
Closed #370: Non-fill items in fillable containers no longer grow or shrink and instead respect their intrinsic size. Use
height
to control the height of non-fill items in fillable containers andmin-height
andmax-height
on fill items to limit how much they are allowed to grow or shrink within a fillable container. (#391)
Minor improvements
-
Closed #375: calling
htmlDependency()
or a function that returns anhtmlDependency()
object (e.g.,fontawesome::fa_html_dependency()
) in an R chunk in an R Markdown or knitr-powered Quarto document will now include the dependency rather than printing the object structure. If you want to print the object structure, you can useprint()
orstr()
. (#376) -
Closed #124:
includeHTML()
will now issue a warning if it detects that the file passed to it contains a complete HTML document.includeHTML()
is designed to include HTML fragments where the contents of the file can be written directly into the current app or document, but subtle errors can occur when the file contains a complete HTML document. In most cases, you should instead usetags$iframe()
to embed external documents. (#382)
htmltools 0.5.5
htmltools 0.5.4
New Features
- Added a new
bindFillRole()
function for modifyingtag()
object(s) into tags that are allowed to grow and shrink when their parent is opinionated about their height. Seehelp(bindFillRole, "htmltools")
for documentation and examples. Note the primary motivation for adding these functions is to power{bslib}
's newcard()
API (in particular, responsive sizing) as well as the newfill
arguments inshiny::plotOutput()
,shiny::imageOutput()
,shiny::uiOutput()
,htmlwidgets::sizingPolicy()
, andhtmlwidgets::shinyWidgetOutput()
. (#343)
Bug fixes
-
Closed #331:
copyDependencyToDir()
createsoutputDir
recursively, which happens in Quarto or whenlib_dir
points to a nested directory. (@gadenbuie, #332) -
Closed #346:
tagQuery()
's$remove()
,$after()
,$before()
,$replaceWith()
had a bug that prevented expected behavior when sibling children values where not tag elements. (#348)
htmltools 0.5.3
Breaking changes
- Closed #305:
htmlPreserve()
no longer uses inline code blocks for Pandoc's raw attribute feature when used inside a non-inline knitr/rmarkdown code chunk, and as a result, in this case, an additional<p>
tag is no longer wrapped around the HTML content. (#306)
Bug fixes
-
Closed #301:
tagQuery()
was failing to copy alltagList()
html dependencies within nest child tag lists.tagQuery()
will now relocate html dependencies as child objects. (#302) -
Closed #290: htmltools previously did not specify which version of fastmap to use, and would fail to install with an old version of fastmap. (#291)
-
copyDependencyToDir()
no longer creates empty directories for dependencies that do not have any files. (@gadenbuie, #276) -
Closed #320:
copyDependencyToDir()
now works with dependencies with specified attributes. (@dmurdoch, #321)
htmltools 0.5.2
Breaking Changes
- Closed #205: When calling
tagGetAttribute(x)
on an object with a non-atomic attribute, a list of untouched values will be returned. It is still recommended to only store character values inside attributes. (#212)
New Features & Improvements
-
{htmltools}
now has its own{pkgdown}
site hosted at https://rstudio.github.io/htmltools/. -
The new
tagQuery()
function provides a jQuery inspired interface to query and/or modify HTMLtag()
(e.g.,div()
) ortagList()
objects. To learn more, see the {pkgdown} article. (#208) -
Added
tagAddRenderHook()
for delaying modification of a tag object until it is rendered. A list of render-time hooks may also be added via the new.renderHook
argument added to alltag()
functions. (#215) -
Closed #243: Added
withTags(.noWS)
to change the default whitespace behavior for all tags within the call towithTags()
. (#245) -
Closed #251: Added
.cssSelector
parameters to tag modifying functions such astagAppendChildren()
ortagAppendChildren()
. The.cssSelector
allows you to target particular (inner) tags of interest. SeetagAppendChildren()
for examples. (#224) -
Closed #225: Added
tagInsertChildren()
to be able to insert child tag objects at a particular location. (#224)
Bug Fixes
-
When retrieving a tag attribute using
tagGetAttribute(tag, attr)
,NA
values will be removed before combining remaining attribute values. If all attribute values areNA
, then a singleNA
value will be returned. (#212) -
Closed #197: Fixed rendering of boolean attributes in
<script>
tags rendered viarenderDependencies()
(#197, thanks @atusy). -
Closed #222: Unnamed attributes are no longer allowed to be appended via
tagAppendAttribs()
. When trying to print unnamed tag attribs, a better error message is provided. (#229)
htmltools 0.5.1.1
- Added shiny as a suggested package.
htmltools 0.5.1
New Features & Improvements
-
Added a new
tagFunction()
for generatingtags
and/orhtmlDependency()
s conditional on the rendering context. For an example, see?tagFunction
. (#180) -
Closed #104:
save_html()
'sfile
argument now properly handles relative paths. (@haozhu233, #105, #192) -
save_html()
now has alang
parameter that can be used to set the lang attribute of<html>
. (@ColinFay, #185) -
Closed #101:
htmlDependency
&renderDependencies
now allow thescript
argument to be given as a named list containing the elements:src
,integrity
,crossorigin
. (@matthewstrasiotto, #188) -
Closed #189:
validateCssUnit()
now acceptsfit-content
. (#190) -
htmlPreserve()
can now optionally use the Pandocraw_attribute
extension to enclose HTML.
Breaking Changes
- Closed #161:
parseCssColors(x)
now requiresx
to be a character vector (it no longer accepts alist()
of strings) and an error is no longer thrown whenmustWork = FALSE
andx
containsNA
value(s). (#194)
Bug fixes
print(as.tags(x))
no longer results in error whenx
is a genericlist()
of tag-like objects. (#181)