diff --git a/DESCRIPTION b/DESCRIPTION index 1b3b6ce9..d0ee1ef6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -20,7 +20,7 @@ URL: https://github.com/rstudio/htmltools, https://rstudio.github.io/htmltools/ BugReports: https://github.com/rstudio/htmltools/issues Depends: - R (>= 2.14.1) + R (>= 3.2.0) Imports: base64enc, digest, diff --git a/R/tags.R b/R/tags.R index e35691bb..b7f8404b 100644 --- a/R/tags.R +++ b/R/tags.R @@ -164,13 +164,14 @@ dropNulls <- function(x) { x[!vapply(x, is.null, FUN.VALUE=logical(1))] } -nullOrEmpty <- function(x) { - length(x) == 0 -} - # Given a vector or list, drop all the NULL or length-0 items in it dropNullsOrEmpty <- function(x) { - x[!vapply(x, nullOrEmpty, FUN.VALUE=logical(1))] + ns <- lengths(x) == 0 + if (any(ns)) { + x <- x[!ns] + } + + x } isResolvedTag <- function(x) { @@ -674,7 +675,6 @@ tags <- lapply(known_tags, function(tagname) { new_function( args = exprs(... = , .noWS = NULL, .renderHook = NULL), expr({ - validateNoWS(.noWS) contents <- dots_list(...) tag(!!tagname, contents, .noWS = .noWS, .renderHook = .renderHook) }), @@ -800,7 +800,8 @@ tag <- function(`_tag_name`, varArgs, .noWS = NULL, .renderHook = NULL) { } # Return tag data structure - structure(st, class = "shiny.tag") + class(st) <- "shiny.tag" + st } isTagList <- function(x) {