diff -Nru r-cran-htmltools-0.3.5/debian/changelog r-cran-htmltools-0.3.6/debian/changelog --- r-cran-htmltools-0.3.5/debian/changelog 2017-09-28 08:06:56.000000000 +0000 +++ r-cran-htmltools-0.3.6/debian/changelog 2017-10-12 15:10:13.000000000 +0000 @@ -1,8 +1,13 @@ -r-cran-htmltools (0.3.5-2build1) artful; urgency=medium +r-cran-htmltools (0.3.6-1) unstable; urgency=medium - * No-change rebuild to pick up r-api-3.4 + * New upstream version + * Moved packaging from SVN to Git + * Convert packaging from cdbs do dh-r + * Standards-Version: 4.1.1 + * debhelper 10 + * Canonical homepage for CRAN packages - -- Graham Inggs Thu, 28 Sep 2017 08:06:56 +0000 + -- Andreas Tille Thu, 12 Oct 2017 17:10:21 +0200 r-cran-htmltools (0.3.5-2) unstable; urgency=medium diff -Nru r-cran-htmltools-0.3.5/debian/compat r-cran-htmltools-0.3.6/debian/compat --- r-cran-htmltools-0.3.5/debian/compat 2014-02-08 16:55:30.000000000 +0000 +++ r-cran-htmltools-0.3.6/debian/compat 2017-10-12 15:10:13.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru r-cran-htmltools-0.3.5/debian/control r-cran-htmltools-0.3.6/debian/control --- r-cran-htmltools-0.3.5/debian/control 2016-04-27 20:12:58.000000000 +0000 +++ r-cran-htmltools-0.3.6/debian/control 2017-10-12 15:10:13.000000000 +0000 @@ -3,22 +3,22 @@ Uploaders: Andreas Tille Section: gnu-r Priority: optional -Build-Depends: debhelper (>= 9), - cdbs, +Build-Depends: debhelper (>= 10), + dh-r, r-base-dev, r-cran-rcpp, r-cran-digest -Standards-Version: 3.9.7 -Vcs-Browser: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/R/r-cran-htmltools/trunk/ -Vcs-Svn: svn://anonscm.debian.org/debian-med/trunk/packages/R/r-cran-htmltools/trunk/ -Homepage: https://cran.r-project.org/web/packages/htmltools/ +Standards-Version: 4.1.1 +Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/r-cran-htmltools.git +Vcs-Git: https://anonscm.debian.org/git/debian-med/r-cran-htmltools.git +Homepage: https://cran.r-project.org/package=htmltools Package: r-cran-htmltools Architecture: any -Depends: ${misc:Depends}, - ${shlibs:Depends}, - ${R:Depends}, - r-cran-rcpp, - r-cran-digest +Depends: ${shlibs:Depends}, + ${misc:Depends}, + ${R:Depends} +Recommends: ${R:Recommends} +Suggests: ${R:Suggests} Description: GNU R tools for HTML This GNU R package provides tools for HTML generation and output. diff -Nru r-cran-htmltools-0.3.5/debian/copyright r-cran-htmltools-0.3.6/debian/copyright --- r-cran-htmltools-0.3.5/debian/copyright 2016-03-23 12:50:00.000000000 +0000 +++ r-cran-htmltools-0.3.6/debian/copyright 2017-10-12 15:10:13.000000000 +0000 @@ -1,13 +1,14 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Contact: Joe Cheng -Source: https://cran.r-project.org/web/packages/shiny/ +Upstream-Name: htmltools +Source: https://cran.r-project.org/package=htmltools Files: * -Copyright: 2013-2016 Joe Cheng +Copyright: 2013-2017 Joe Cheng License: GPL-2+ Files: debian/* -Copyright: 2016 Andreas Tille +Copyright: 2016-2017 Andreas Tille License: GPL-2+ License: GPL-2+ diff -Nru r-cran-htmltools-0.3.5/debian/rules r-cran-htmltools-0.3.6/debian/rules --- r-cran-htmltools-0.3.5/debian/rules 2016-03-22 22:36:31.000000000 +0000 +++ r-cran-htmltools-0.3.6/debian/rules 2017-10-12 15:10:13.000000000 +0000 @@ -1,3 +1,4 @@ #!/usr/bin/make -f -include /usr/share/R/debian/r-cran.mk +%: + dh $@ --buildsystem R diff -Nru r-cran-htmltools-0.3.5/DESCRIPTION r-cran-htmltools-0.3.6/DESCRIPTION --- r-cran-htmltools-0.3.5/DESCRIPTION 2016-03-21 22:36:11.000000000 +0000 +++ r-cran-htmltools-0.3.6/DESCRIPTION 2017-04-28 07:41:46.000000000 +0000 @@ -1,8 +1,8 @@ Package: htmltools Type: Package Title: Tools for HTML -Version: 0.3.5 -Date: 2016-03-19 +Version: 0.3.6 +Date: 2017-04-26 Author: RStudio, Inc. Maintainer: Joe Cheng Description: Tools for HTML generation and output. @@ -13,9 +13,9 @@ License: GPL (>= 2) URL: https://github.com/rstudio/htmltools BugReports: https://github.com/rstudio/htmltools/issues -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 LinkingTo: Rcpp NeedsCompilation: yes -Packaged: 2016-03-21 21:26:31 UTC; jcheng +Packaged: 2017-04-27 00:04:32 UTC; jcheng Repository: CRAN -Date/Publication: 2016-03-21 23:36:11 +Date/Publication: 2017-04-28 07:41:46 UTC diff -Nru r-cran-htmltools-0.3.5/man/as.tags.Rd r-cran-htmltools-0.3.6/man/as.tags.Rd --- r-cran-htmltools-0.3.5/man/as.tags.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/as.tags.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -16,4 +16,3 @@ the child of a tag or \code{tagList}. The default implementation simply calls \code{\link[base]{as.character}}. } - diff -Nru r-cran-htmltools-0.3.5/man/browsable.Rd r-cran-htmltools-0.3.6/man/browsable.Rd --- r-cran-htmltools-0.3.5/man/browsable.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/browsable.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -30,4 +30,3 @@ You can override the default browsability of an HTML object by explicitly passing \code{browse = TRUE} (or \code{FALSE}) to the \code{print} function. } - diff -Nru r-cran-htmltools-0.3.5/man/builder.Rd r-cran-htmltools-0.3.6/man/builder.Rd --- r-cran-htmltools-0.3.5/man/builder.Rd 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/builder.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,25 +1,25 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{builder} -\alias{a} -\alias{br} \alias{builder} -\alias{code} -\alias{div} -\alias{em} +\alias{tags} +\alias{p} \alias{h1} \alias{h2} \alias{h3} \alias{h4} \alias{h5} \alias{h6} -\alias{hr} -\alias{img} -\alias{p} -\alias{pre} +\alias{a} +\alias{br} +\alias{div} \alias{span} +\alias{pre} +\alias{code} +\alias{img} \alias{strong} -\alias{tags} +\alias{em} +\alias{hr} \title{HTML Builder Functions} \usage{ tags @@ -95,4 +95,3 @@ ) cat(as.character(doc)) } - diff -Nru r-cran-htmltools-0.3.5/man/copyDependencyToDir.Rd r-cran-htmltools-0.3.6/man/copyDependencyToDir.Rd --- r-cran-htmltools-0.3.5/man/copyDependencyToDir.Rd 2015-12-30 21:20:07.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/copyDependencyToDir.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -36,4 +36,3 @@ \code{\link{makeDependencyRelative}} can be used with the returned value to make the path relative to a specific directory. } - diff -Nru r-cran-htmltools-0.3.5/man/css.Rd r-cran-htmltools-0.3.6/man/css.Rd --- r-cran-htmltools-0.3.5/man/css.Rd 2015-12-22 17:06:42.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/css.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -45,4 +45,3 @@ ) } - diff -Nru r-cran-htmltools-0.3.5/man/findDependencies.Rd r-cran-htmltools-0.3.6/man/findDependencies.Rd --- r-cran-htmltools-0.3.5/man/findDependencies.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/findDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -4,10 +4,12 @@ \alias{findDependencies} \title{Collect attached dependencies from HTML tag object} \usage{ -findDependencies(tags) +findDependencies(tags, tagify = TRUE) } \arguments{ \item{tags}{A tag-like object to search for dependencies.} + +\item{tagify}{Whether to tagify the input before searching for dependencies.} } \value{ A list of \code{\link{htmlDependency}} objects. @@ -15,4 +17,3 @@ \description{ Walks a hierarchy of tags looking for attached dependencies. } - diff -Nru r-cran-htmltools-0.3.5/man/htmlDependencies.Rd r-cran-htmltools-0.3.6/man/htmlDependencies.Rd --- r-cran-htmltools-0.3.5/man/htmlDependencies.Rd 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/htmlDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/html_dependency.R \name{htmlDependencies} -\alias{attachDependencies} \alias{htmlDependencies} \alias{htmlDependencies<-} +\alias{attachDependencies} \title{HTML dependency metadata} \usage{ htmlDependencies(x) @@ -53,4 +53,3 @@ attachDependencies(div("Code here"), dep) } - diff -Nru r-cran-htmltools-0.3.5/man/htmlDependency.Rd r-cran-htmltools-0.3.6/man/htmlDependency.Rd --- r-cran-htmltools-0.3.5/man/htmlDependency.Rd 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/htmlDependency.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -5,7 +5,8 @@ \title{Define an HTML dependency} \usage{ htmlDependency(name, version, src, meta = NULL, script = NULL, - stylesheet = NULL, head = NULL, attachment = NULL, all_files = TRUE) + stylesheet = NULL, head = NULL, attachment = NULL, package = NULL, + all_files = TRUE) } \arguments{ \item{name}{Library name} @@ -30,6 +31,10 @@ \item{attachment}{Attachment(s) to include within the document head. See Details.} +\item{package}{An R package name to indicate where to find the \code{src} +directory when \code{src} is a relative path (see +\code{\link{resolveDependencies}}).} + \item{all_files}{Whether all files under the \code{src} directory are dependency files. If \code{FALSE}, only the files specified in \code{script}, \code{stylesheet}, and \code{attachment} are treated as @@ -78,4 +83,3 @@ Use \code{\link{attachDependencies}} to associate a list of dependencies with the HTML it belongs with. } - diff -Nru r-cran-htmltools-0.3.5/man/htmlEscape.Rd r-cran-htmltools-0.3.6/man/htmlEscape.Rd --- r-cran-htmltools-0.3.5/man/htmlEscape.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/htmlEscape.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -18,4 +18,3 @@ Escape HTML entities contained in a character vector so that it can be safely included as text or an attribute value within an HTML document } - diff -Nru r-cran-htmltools-0.3.5/man/htmlPreserve.Rd r-cran-htmltools-0.3.6/man/htmlPreserve.Rd --- r-cran-htmltools-0.3.5/man/htmlPreserve.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/htmlPreserve.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{htmlPreserve} -\alias{extractPreserveChunks} \alias{htmlPreserve} +\alias{extractPreserveChunks} \alias{restorePreserveChunks} \title{Preserve HTML regions} \usage{ @@ -63,4 +63,3 @@ output } - diff -Nru r-cran-htmltools-0.3.5/man/html_print.Rd r-cran-htmltools-0.3.6/man/html_print.Rd --- r-cran-htmltools-0.3.5/man/html_print.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/html_print.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -22,4 +22,3 @@ Convenience method that provides an implementation of the \code{\link[base:print]{print}} method for HTML content. } - diff -Nru r-cran-htmltools-0.3.5/man/HTML.Rd r-cran-htmltools-0.3.6/man/HTML.Rd --- r-cran-htmltools-0.3.5/man/HTML.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/HTML.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -24,4 +24,3 @@ cat(as.character(el)) } - diff -Nru r-cran-htmltools-0.3.5/man/htmlTemplate.Rd r-cran-htmltools-0.3.6/man/htmlTemplate.Rd --- r-cran-htmltools-0.3.5/man/htmlTemplate.Rd 2016-01-22 02:12:21.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/htmlTemplate.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -29,4 +29,3 @@ \seealso{ \code{\link{renderDocument}} } - diff -Nru r-cran-htmltools-0.3.5/man/include.Rd r-cran-htmltools-0.3.6/man/include.Rd --- r-cran-htmltools-0.3.5/man/include.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/include.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -2,11 +2,11 @@ % Please edit documentation in R/tags.R \name{include} \alias{include} -\alias{includeCSS} \alias{includeHTML} +\alias{includeText} \alias{includeMarkdown} +\alias{includeCSS} \alias{includeScript} -\alias{includeText} \title{Include Content From a File} \usage{ includeHTML(path) @@ -44,4 +44,3 @@ The \code{includeMarkdown} function requires the \code{markdown} package. } - diff -Nru r-cran-htmltools-0.3.5/man/knitr_methods.Rd r-cran-htmltools-0.3.6/man/knitr_methods.Rd --- r-cran-htmltools-0.3.5/man/knitr_methods.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/knitr_methods.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{knitr_methods} -\alias{knit_print.html} +\alias{knitr_methods} \alias{knit_print.shiny.tag} +\alias{knit_print.html} \alias{knit_print.shiny.tag.list} -\alias{knitr_methods} \title{Knitr S3 methods} \usage{ knit_print.shiny.tag(x, ...) @@ -22,4 +22,3 @@ These S3 methods are necessary to allow HTML tags to print themselves in knitr/rmarkdown documents. } - diff -Nru r-cran-htmltools-0.3.5/man/makeDependencyRelative.Rd r-cran-htmltools-0.3.6/man/makeDependencyRelative.Rd --- r-cran-htmltools-0.3.5/man/makeDependencyRelative.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/makeDependencyRelative.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -30,4 +30,3 @@ \seealso{ \code{\link{copyDependencyToDir}} } - diff -Nru r-cran-htmltools-0.3.5/man/print.html.Rd r-cran-htmltools-0.3.6/man/print.html.Rd --- r-cran-htmltools-0.3.5/man/print.html.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/print.html.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{print.shiny.tag} -\alias{print.html} \alias{print.shiny.tag} +\alias{print.html} \title{Print method for HTML/tags} \usage{ \method{print}{shiny.tag}(x, browse = is.browsable(x), ...) @@ -23,4 +23,3 @@ S3 method for printing HTML that prints markup or renders HTML in a web browser. } - diff -Nru r-cran-htmltools-0.3.5/man/renderDependencies.Rd r-cran-htmltools-0.3.6/man/renderDependencies.Rd --- r-cran-htmltools-0.3.5/man/renderDependencies.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/renderDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -27,4 +27,3 @@ Create the appropriate HTML markup for including dependencies in an HTML document. } - diff -Nru r-cran-htmltools-0.3.5/man/renderDocument.Rd r-cran-htmltools-0.3.6/man/renderDocument.Rd --- r-cran-htmltools-0.3.5/man/renderDocument.Rd 2015-12-22 17:06:42.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/renderDocument.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -29,4 +29,3 @@ \code{""} in the document, and replaces it with the web dependencies. } - diff -Nru r-cran-htmltools-0.3.5/man/renderTags.Rd r-cran-htmltools-0.3.6/man/renderTags.Rd --- r-cran-htmltools-0.3.5/man/renderTags.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/renderTags.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{renderTags} -\alias{doRenderTags} \alias{renderTags} +\alias{doRenderTags} \title{Render tags into HTML} \usage{ renderTags(x, singletons = character(0), indent = 0) @@ -49,4 +49,3 @@ singleton, head, and dependency handling, and simply renders the given tag objects as HTML. } - diff -Nru r-cran-htmltools-0.3.5/man/resolveDependencies.Rd r-cran-htmltools-0.3.6/man/resolveDependencies.Rd --- r-cran-htmltools-0.3.5/man/resolveDependencies.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/resolveDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -4,10 +4,14 @@ \alias{resolveDependencies} \title{Resolve a list of dependencies} \usage{ -resolveDependencies(dependencies) +resolveDependencies(dependencies, resolvePackageDir = TRUE) } \arguments{ \item{dependencies}{A list of \code{\link{htmlDependency}} objects.} + +\item{resolvePackageDir}{Whether to resolve the relative path to an absolute +path via \code{\link{system.file}} when the \code{package} attribute is +present in a dependency object.} } \value{ dependencies A list of \code{\link{htmlDependency}} objects with @@ -18,4 +22,3 @@ name equality). If multiple versions of a dependency are found, the copy with the latest version number is used. } - diff -Nru r-cran-htmltools-0.3.5/man/save_html.Rd r-cran-htmltools-0.3.6/man/save_html.Rd --- r-cran-htmltools-0.3.5/man/save_html.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/save_html.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -19,4 +19,3 @@ Save the specified HTML object to a file, copying all of it's dependencies to the directory specified via \code{libdir}. } - diff -Nru r-cran-htmltools-0.3.5/man/singleton.Rd r-cran-htmltools-0.3.6/man/singleton.Rd --- r-cran-htmltools-0.3.5/man/singleton.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/singleton.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -1,8 +1,8 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/tags.R \name{singleton} -\alias{is.singleton} \alias{singleton} +\alias{is.singleton} \title{Include content only once} \usage{ singleton(x, value = TRUE) @@ -20,4 +20,3 @@ document-generating code more than once. Only the first appearance of the content (in document order) will be used. } - diff -Nru r-cran-htmltools-0.3.5/man/singleton_tools.Rd r-cran-htmltools-0.3.6/man/singleton_tools.Rd --- r-cran-htmltools-0.3.5/man/singleton_tools.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/singleton_tools.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -33,4 +33,3 @@ Functions for manipulating \code{\link{singleton}} objects in tag hierarchies. Intended for framework authors. } - diff -Nru r-cran-htmltools-0.3.5/man/subtractDependencies.Rd r-cran-htmltools-0.3.6/man/subtractDependencies.Rd --- r-cran-htmltools-0.3.5/man/subtractDependencies.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/subtractDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -30,4 +30,3 @@ dependency being removed is later than the version of the dependency object that is causing the removal. } - diff -Nru r-cran-htmltools-0.3.5/man/suppressDependencies.Rd r-cran-htmltools-0.3.6/man/suppressDependencies.Rd --- r-cran-htmltools-0.3.5/man/suppressDependencies.Rd 2015-12-22 17:06:42.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/suppressDependencies.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -21,4 +21,3 @@ \code{\link[htmltools]{htmlDependency}} } - diff -Nru r-cran-htmltools-0.3.5/man/tag.Rd r-cran-htmltools-0.3.6/man/tag.Rd --- r-cran-htmltools-0.3.5/man/tag.Rd 2015-12-24 01:53:39.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/tag.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -2,13 +2,14 @@ % Please edit documentation in R/tags.R \name{tag} \alias{tag} +\alias{tagList} \alias{tagAppendAttributes} +\alias{tagHasAttribute} +\alias{tagGetAttribute} \alias{tagAppendChild} \alias{tagAppendChildren} -\alias{tagGetAttribute} -\alias{tagHasAttribute} -\alias{tagList} \alias{tagSetChildren} +\alias{tag} \title{HTML Tag Object} \usage{ tagList(...) @@ -71,4 +72,3 @@ tags$p("Text here")) tagList(x) } - diff -Nru r-cran-htmltools-0.3.5/man/urlEncodePath.Rd r-cran-htmltools-0.3.6/man/urlEncodePath.Rd --- r-cran-htmltools-0.3.5/man/urlEncodePath.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/urlEncodePath.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -14,4 +14,3 @@ \code{\link[utils]{URLencode}} with \code{reserved = TRUE} except that \code{/} is preserved. } - diff -Nru r-cran-htmltools-0.3.5/man/validateCssUnit.Rd r-cran-htmltools-0.3.6/man/validateCssUnit.Rd --- r-cran-htmltools-0.3.5/man/validateCssUnit.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/validateCssUnit.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -26,8 +26,8 @@ Single element character vectors must be \code{"auto"} or \code{"inherit"}, or a number. If the number has a suffix, it must be valid: \code{px}, \code{\%}, \code{em}, \code{pt}, \code{in}, \code{cm}, \code{mm}, \code{ex}, -or \code{pc}. If the number has no suffix, the suffix \code{"px"} is -appended. +\code{pc}, \code{vh}, \code{vw}, \code{vmin}, or \code{vmax}. +If the number has no suffix, the suffix \code{"px"} is appended. Any other value will cause an error to be thrown. } @@ -35,4 +35,3 @@ validateCssUnit("10\%") validateCssUnit(400) #treated as '400px' } - diff -Nru r-cran-htmltools-0.3.5/man/withTags.Rd r-cran-htmltools-0.3.6/man/withTags.Rd --- r-cran-htmltools-0.3.5/man/withTags.Rd 2015-12-10 23:29:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/man/withTags.Rd 2017-04-27 00:04:15.000000000 +0000 @@ -39,4 +39,3 @@ } - diff -Nru r-cran-htmltools-0.3.5/MD5 r-cran-htmltools-0.3.6/MD5 --- r-cran-htmltools-0.3.5/MD5 2016-03-21 22:36:11.000000000 +0000 +++ r-cran-htmltools-0.3.6/MD5 2017-04-28 07:41:46.000000000 +0000 @@ -1,46 +1,48 @@ -72c03ca6886933e00b494cea3217e13f *DESCRIPTION -3eff63e6ff5eb3d2749b77f1e1a13ae1 *NAMESPACE -6f4e14ce9f5b4301c0b44af926525e9b *NEWS -c1e4413f5fc7eba2f785e76fdda026be *R/RcppExports.R -9328debfe564d97e4c59eb9e02ad2235 *R/html_dependency.R +630310adf5be92835b9544240f92376c *DESCRIPTION +41ac34eea891be5f999ed8b44f87e476 *NAMESPACE +738bee7e0dd52e6d69ccfe44c8dc0394 *NEWS +aa9302feb5eec2cedcb00f9d88e5af74 *R/RcppExports.R +411239656a10eb50c5d1d217b9b57ede *R/html_dependency.R 7bee8b23618adb2848412fedc7164709 *R/html_escape.R b3e3d3353ebc757321b60abcad04397c *R/html_print.R -6a300f33f56fc7d5a8ea0fb5c7634d77 *R/tags.R -06648459a4195a4c81282ae5729edc97 *R/template.R -747b00f84aac5d38d90c382b7acea766 *man/HTML.Rd -5f6685813bb68b37c2cef66dc64ec6b4 *man/as.tags.Rd -93da0c851632d533098dfa737ef69274 *man/browsable.Rd -a1f0a58f58e94685b9fe09314dc949ef *man/builder.Rd -9eb6d8d33eb3d7278c44f08a52c4c153 *man/copyDependencyToDir.Rd -8487ea5a1d6d5d5a37f14e56776b263d *man/css.Rd -033d3ca20f2ca5598f1a146aabe59184 *man/findDependencies.Rd -2af4b1961a102b3ae97d80bfc652ebe2 *man/htmlDependencies.Rd -ee1b263b7ca40387a68f9fca8e2eadb1 *man/htmlDependency.Rd -e204dbba8c1854906529114e0d2e47f2 *man/htmlEscape.Rd -4e6d962c82d788fbb49b51264eeb9123 *man/htmlPreserve.Rd -c12e2e060c1f0a252c7339bbd946d3c2 *man/htmlTemplate.Rd -823f31b10e4c759bd944eed49f8224da *man/html_print.Rd -6ef8c0f2ba87b45f17817f7febda6365 *man/include.Rd -4ee94c21c8d63531903bbff3bb75926f *man/knitr_methods.Rd -26aa8ef492ac58d38483f14c8897a077 *man/makeDependencyRelative.Rd -958b662a2a54e8030649e391e9ed1ded *man/print.html.Rd -9e4c782f5ad5aed1b31f1bf70beca638 *man/renderDependencies.Rd -8478bfe350d31adff0e94ebf5a3aea65 *man/renderDocument.Rd -3f71ee0061e139ac0fc10f0e38e0765c *man/renderTags.Rd -bf9c821c3fcac5b092940b1acbe8f4df *man/resolveDependencies.Rd -517d1ed333b880fc0846d82f09d86f96 *man/save_html.Rd -03a6dd0aab6a1150f8c0b575aacc0806 *man/singleton.Rd -ef71b945ad76fb3a1d8e8d89fbecc19b *man/singleton_tools.Rd -c27574242254c7379b602e957ecfb7d9 *man/subtractDependencies.Rd -0b686655aaa750cff5d37a674207f6bd *man/suppressDependencies.Rd -e7721483d5e136d7652edba62e64e54d *man/tag.Rd -cb34418668e63388d3edd67d2dd90c52 *man/urlEncodePath.Rd -60be5348923d73ebf9235e6e790628e3 *man/validateCssUnit.Rd -4a499bda5c52e3a41a9d0d01e29b3536 *man/withTags.Rd -978ffdd268a174b06c94b067b18c46d7 *src/RcppExports.cpp +f02106c1cda38dbdd97d40370f99e4e1 *R/tags.R +31064a678bc8589cfd29497262ba2110 *R/template.R +ebcfaa458d3bdefadded43a4d64cfff9 *man/HTML.Rd +c00712c215b7bbb80a6287fee17f3c24 *man/as.tags.Rd +88494342535e91fa8972fd2fc3f1fde5 *man/browsable.Rd +6bfa2d7cdaca48f17caaa6b11902e28e *man/builder.Rd +bcfebb5f9577a5013fe33242fdec9645 *man/copyDependencyToDir.Rd +11bd91091ffdde442e05a6a26823a84d *man/css.Rd +83f5a6962792ba50b19b48dc1c65fd39 *man/findDependencies.Rd +b1b2d807ab611007bdf9b582b64e5f24 *man/htmlDependencies.Rd +9f7aaeaaa75598fbb0ab71e20359965d *man/htmlDependency.Rd +91c1824deb08f57376108765fd29dbaa *man/htmlEscape.Rd +475bf569370053b828bf69e4bb283825 *man/htmlPreserve.Rd +516afef01fac034a4e414e7515a7b71e *man/htmlTemplate.Rd +f0a6e81826dcaf3e212e70c63e67189e *man/html_print.Rd +4f34e99b07220d7a2fa41b9029a16862 *man/include.Rd +93bd5afcdac04bc4c5322122f0710e75 *man/knitr_methods.Rd +2b18a3612062f7783435b8dfd1e215f4 *man/makeDependencyRelative.Rd +16159aa45a251fb364e5fd1fd144d1d7 *man/print.html.Rd +504914f9f04e3a96f20d707b5acc341f *man/renderDependencies.Rd +dee26db7dd1d20fc2f13746ef9e9ae1d *man/renderDocument.Rd +5943238916b4b5866e49846183c95f98 *man/renderTags.Rd +3d7d639046044b164f7dabe61158c67d *man/resolveDependencies.Rd +3e8fac6287e21baa2e492fb2e581689b *man/save_html.Rd +72d8cd938a5a644116813539b07d0576 *man/singleton.Rd +0c319382fa19718f0d0da795c20501ce *man/singleton_tools.Rd +f0de725705e4f99a532bc4a9cc58664c *man/subtractDependencies.Rd +127fb8880888366a5c37c0b3b7eac069 *man/suppressDependencies.Rd +c36b122e98a5f4a6e89892f9cf8336ba *man/tag.Rd +cd3894dd85e4d84cc4ff5dc2a567fd4b *man/urlEncodePath.Rd +b107695e665e7daf7fb074bfd1ad4d94 *man/validateCssUnit.Rd +dec0c8e4a1f951e26daa06e9c07f986b *man/withTags.Rd +3305b464312f0fccbc917c491e79201d *src/RcppExports.cpp +a941e5cc1f933a4245b62b772a9263c5 *src/init.c f7dbf02b3735f8a64fb1cc9264416713 *src/template.cpp d5386f261693f9f4a5dda7b6fe0aa9f0 *tests/test-all.R +4de059d582d96a7c86907beb670b819d *tests/testthat/template-basic.html ce9c101bbebef449d432567b9a29e9f9 *tests/testthat/template-document.html bd23b1f0bd8705c3fe39c9f537cd1305 *tests/testthat/test-deps.r -2d382055a6affd4f39407b0664c04041 *tests/testthat/test-tags.r -0c93372a28e38db6c9e7146c6a1644af *tests/testthat/test-template.R +f619582da6617e70858b2c462f956f9b *tests/testthat/test-tags.r +2d57750590f71f1bb6a96604a05a7d23 *tests/testthat/test-template.R diff -Nru r-cran-htmltools-0.3.5/NAMESPACE r-cran-htmltools-0.3.6/NAMESPACE --- r-cran-htmltools-0.3.5/NAMESPACE 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/NAMESPACE 2017-04-27 00:04:15.000000000 +0000 @@ -86,4 +86,4 @@ import(digest) import(utils) importFrom(Rcpp,sourceCpp) -useDynLib(htmltools) +useDynLib(htmltools, .registration = TRUE) diff -Nru r-cran-htmltools-0.3.5/NEWS r-cran-htmltools-0.3.6/NEWS --- r-cran-htmltools-0.3.5/NEWS 2016-03-21 21:23:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/NEWS 2017-04-26 23:49:39.000000000 +0000 @@ -1,3 +1,16 @@ +htmltools 0.3.6 +-------------------------------------------------------------------------------- + +* `validateCssUnit()` now accepts viewport units (vw, vh, vmin, vmax). (#56) + +* `restorePreserveChunks()` marks the output with the correct encoding now + (UTF-8). + +* Length-0 attributes are now dropped, like NULLs. (#65) + +* Fixed #69: On Windows, `renderDocument()` did not mark output as UTF-8 if the + head was UTF-8 but body was ASCII. (#71) + htmltools 0.3.5 -------------------------------------------------------------------------------- diff -Nru r-cran-htmltools-0.3.5/R/html_dependency.R r-cran-htmltools-0.3.6/R/html_dependency.R --- r-cran-htmltools-0.3.5/R/html_dependency.R 2016-03-21 21:23:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/R/html_dependency.R 2017-04-26 23:49:08.000000000 +0000 @@ -19,6 +19,9 @@ #' @param head Arbitrary lines of HTML to insert into the document head #' @param attachment Attachment(s) to include within the document head. See #' Details. +#' @param package An R package name to indicate where to find the \code{src} +#' directory when \code{src} is a relative path (see +#' \code{\link{resolveDependencies}}). #' @param all_files Whether all files under the \code{src} directory are #' dependency files. If \code{FALSE}, only the files specified in #' \code{script}, \code{stylesheet}, and \code{attachment} are treated as @@ -67,6 +70,7 @@ stylesheet = NULL, head = NULL, attachment = NULL, + package = NULL, all_files = TRUE) { # This function shouldn't be called from a namespace environment with @@ -99,6 +103,7 @@ stylesheet = stylesheet, head = head, attachment = attachment, + package = package, all_files = all_files )) } @@ -270,6 +275,9 @@ return(dependency) } } + # resolve the relative file path to absolute path in package + if (!is.null(dependency$package)) + dir <- system.file(dir, package = dependency$package) if (length(outputDir) != 1 || outputDir %in% c("", "/")) stop('outputDir must be of length 1 and cannot be "" or "/"') diff -Nru r-cran-htmltools-0.3.5/R/RcppExports.R r-cran-htmltools-0.3.6/R/RcppExports.R --- r-cran-htmltools-0.3.5/R/RcppExports.R 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/R/RcppExports.R 2017-04-26 23:56:36.000000000 +0000 @@ -1,4 +1,4 @@ -# This file was generated by Rcpp::compileAttributes +# Generated by using Rcpp::compileAttributes() -> do not edit by hand # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 template_dfa <- function(x) { diff -Nru r-cran-htmltools-0.3.5/R/tags.R r-cran-htmltools-0.3.6/R/tags.R --- r-cran-htmltools-0.3.5/R/tags.R 2016-03-21 21:23:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/R/tags.R 2017-04-26 23:49:08.000000000 +0000 @@ -68,11 +68,14 @@ #' the latest version number is used. #' #' @param dependencies A list of \code{\link{htmlDependency}} objects. +#' @param resolvePackageDir Whether to resolve the relative path to an absolute +#' path via \code{\link{system.file}} when the \code{package} attribute is +#' present in a dependency object. #' @return dependencies A list of \code{\link{htmlDependency}} objects with #' redundancies removed. #' #' @export -resolveDependencies <- function(dependencies) { +resolveDependencies <- function(dependencies, resolvePackageDir = TRUE) { # Remove nulls deps <- dependencies[!sapply(dependencies, is.null)] @@ -88,7 +91,13 @@ sorted <- order(ifelse(depnames == depname, TRUE, NA), depvers, na.last = NA, decreasing = TRUE) # The first element in the list is the one with the largest version. - deps[[sorted[[1]]]] + dep <- deps[[sorted[[1]]]] + if (resolvePackageDir && !is.null(dep$package)) { + dir <- dep$src$file + if (!is.null(dir)) dep$src$file <- system.file(dir, package = dep$package) + dep$package <- NULL + } + dep })) } @@ -150,9 +159,10 @@ } nullOrEmpty <- function(x) { - is.null(x) || length(x) == 0 + length(x) == 0 } -# Given a vector or list, drop all the NULL items in it + +# 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))] } @@ -333,9 +343,9 @@ if (is.null(varArgsNames)) varArgsNames <- character(length=length(varArgs)) - # Named arguments become attribs, dropping NULL values + # Named arguments become attribs, dropping NULL and length-0 values named_idx <- nzchar(varArgsNames) - attribs <- dropNulls(varArgs[named_idx]) + attribs <- dropNullsOrEmpty(varArgs[named_idx]) # Unnamed arguments are flattened and added as children. # Use unname() to remove the names attribute from the list, which would @@ -472,7 +482,7 @@ # Do singleton and head processing before rendering singletonInfo <- takeSingletons(x, singletons) headInfo <- takeHeads(singletonInfo$ui) - deps <- resolveDependencies(findDependencies(singletonInfo$ui)) + deps <- resolveDependencies(findDependencies(singletonInfo$ui, tagify = FALSE)) headIndent <- if (is.numeric(indent)) indent + 1 else indent headHtml <- doRenderTags(headInfo$head, indent = headIndent) @@ -636,12 +646,16 @@ #' Walks a hierarchy of tags looking for attached dependencies. #' #' @param tags A tag-like object to search for dependencies. +#' @param tagify Whether to tagify the input before searching for dependencies. #' #' @return A list of \code{\link{htmlDependency}} objects. #' #' @export -findDependencies <- function(tags) { - dep <- htmlDependencies(tagify(tags)) +findDependencies <- function(tags, tagify = TRUE) { + if (isTRUE(tagify)) { + tags <- tagify(tags) + } + dep <- htmlDependencies(tags) if (!is.null(dep) && inherits(dep, "html_dependency")) dep <- list(dep) children <- if (is.list(tags)) { @@ -651,7 +665,7 @@ tags } } - childDeps <- unlist(lapply(children, findDependencies), recursive = FALSE) + childDeps <- unlist(lapply(children, findDependencies, tagify = FALSE), recursive = FALSE) c(childDeps, if (!is.null(dep)) dep) } @@ -1140,8 +1154,11 @@ #' @rdname htmlPreserve #' @export restorePreserveChunks <- function(strval, chunks) { + strval <- enc2utf8(strval) + chunks <- enc2utf8(chunks) for (id in names(chunks)) strval <- gsub(id, chunks[[id]], strval, fixed = TRUE, useBytes = TRUE) + Encoding(strval) <- 'UTF-8' strval } @@ -1160,7 +1177,7 @@ knit_print.shiny.tag <- function(x, ...) { x <- tagify(x) output <- surroundSingletons(x) - deps <- resolveDependencies(findDependencies(x)) + deps <- resolveDependencies(findDependencies(x, tagify = FALSE), resolvePackageDir = FALSE) content <- takeHeads(output) head_content <- doRenderTags(tagList(content$head)) @@ -1177,7 +1194,7 @@ #' @rdname knitr_methods #' @export knit_print.html <- function(x, ...) { - deps <- resolveDependencies(findDependencies(x)) + deps <- resolveDependencies(findDependencies(x, tagify = FALSE)) knitr::asis_output(htmlPreserve(as.character(x)), meta = if (length(deps)) list(deps)) } @@ -1354,8 +1371,9 @@ #' Single element character vectors must be \code{"auto"} or \code{"inherit"}, #' or a number. If the number has a suffix, it must be valid: \code{px}, #' \code{\%}, \code{em}, \code{pt}, \code{in}, \code{cm}, \code{mm}, \code{ex}, -#' or \code{pc}. If the number has no suffix, the suffix \code{"px"} is -#' appended. +#' \code{pc}, \code{vh}, \code{vw}, \code{vmin}, or \code{vmax}. +#' If the number has no suffix, the suffix \code{"px"} is appended. +#' #' #' Any other value will cause an error to be thrown. #' @@ -1380,7 +1398,7 @@ x <- as.numeric(x) pattern <- - "^(auto|inherit|((\\.\\d+)|(\\d+(\\.\\d+)?))(%|in|cm|mm|em|ex|pt|pc|px))$" + "^(auto|inherit|((\\.\\d+)|(\\d+(\\.\\d+)?))(%|in|cm|mm|em|ex|pt|pc|px|vh|vw|vmin|vmax))$" if (is.character(x) && !grepl(pattern, x)) { diff -Nru r-cran-htmltools-0.3.5/R/template.R r-cran-htmltools-0.3.6/R/template.R --- r-cran-htmltools-0.3.5/R/template.R 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/R/template.R 2017-04-27 00:03:39.000000000 +0000 @@ -17,7 +17,7 @@ #' #' @seealso \code{\link{renderDocument}} #' @export -#' @useDynLib htmltools +#' @useDynLib htmltools, .registration = TRUE #' @importFrom Rcpp sourceCpp htmlTemplate <- function(filename = NULL, ..., text_ = NULL, document_ = "auto") { if (!xor(is.null(filename), is.null(text_))) { @@ -120,15 +120,22 @@ # Put content in the section head_content <- paste0( - ' ', - sprintf(' ', + ' \n', + sprintf(' \n', paste(result$singletons, collapse = ',') ), - sprintf(' ', + sprintf(' \n', depStr ), depHtml, c(result$head, recursive = TRUE) ) - sub("", head_content, result$html, fixed = TRUE) + # Need to mark result as UTF-8. If body is ASCII, it will be marked with + # encoding "unknown". If the head has UTF-8 characters and is marked as + # "UTF-8", the output string here will have the correct UTF-8 byte sequences, + # but will be marked as "unknown", which causes the wrong text to be + # displayed. See https://github.com/rstudio/shiny/issues/1395 + res <- sub("", head_content, result$html, fixed = TRUE) + Encoding(res) <- "UTF-8" + res } diff -Nru r-cran-htmltools-0.3.5/src/init.c r-cran-htmltools-0.3.6/src/init.c --- r-cran-htmltools-0.3.5/src/init.c 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-htmltools-0.3.6/src/init.c 2017-04-27 00:04:32.000000000 +0000 @@ -0,0 +1,18 @@ +#include +#include +#include // for NULL +#include + +/* .Call calls */ +extern SEXP htmltools_template_dfa(SEXP); + +static const R_CallMethodDef CallEntries[] = { + {"htmltools_template_dfa", (DL_FUNC) &htmltools_template_dfa, 1}, + {NULL, NULL, 0} +}; + +void R_init_htmltools(DllInfo *dll) +{ + R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); + R_useDynamicSymbols(dll, FALSE); +} diff -Nru r-cran-htmltools-0.3.5/src/RcppExports.cpp r-cran-htmltools-0.3.6/src/RcppExports.cpp --- r-cran-htmltools-0.3.5/src/RcppExports.cpp 2016-03-21 21:26:31.000000000 +0000 +++ r-cran-htmltools-0.3.6/src/RcppExports.cpp 2017-04-27 00:04:32.000000000 +0000 @@ -1,4 +1,4 @@ -// This file was generated by Rcpp::compileAttributes +// Generated by using Rcpp::compileAttributes() -> do not edit by hand // Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 #include @@ -9,10 +9,10 @@ std::vector template_dfa(CharacterVector x); RcppExport SEXP htmltools_template_dfa(SEXP xSEXP) { BEGIN_RCPP - Rcpp::RObject __result; - Rcpp::RNGScope __rngScope; + Rcpp::RObject rcpp_result_gen; + Rcpp::RNGScope rcpp_rngScope_gen; Rcpp::traits::input_parameter< CharacterVector >::type x(xSEXP); - __result = Rcpp::wrap(template_dfa(x)); - return __result; + rcpp_result_gen = Rcpp::wrap(template_dfa(x)); + return rcpp_result_gen; END_RCPP } diff -Nru r-cran-htmltools-0.3.5/tests/testthat/template-basic.html r-cran-htmltools-0.3.6/tests/testthat/template-basic.html --- r-cran-htmltools-0.3.5/tests/testthat/template-basic.html 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-htmltools-0.3.6/tests/testthat/template-basic.html 2017-04-26 23:49:08.000000000 +0000 @@ -0,0 +1,8 @@ + + +{{ headContent() }} + + +{{ body }} + + diff -Nru r-cran-htmltools-0.3.5/tests/testthat/test-tags.r r-cran-htmltools-0.3.6/tests/testthat/test-tags.r --- r-cran-htmltools-0.3.5/tests/testthat/test-tags.r 2016-03-21 21:23:36.000000000 +0000 +++ r-cran-htmltools-0.3.6/tests/testthat/test-tags.r 2017-04-26 23:49:08.000000000 +0000 @@ -168,12 +168,24 @@ div(b = "value") ) + # length-0 attributes are dropped + expect_identical( + div(a = character(), b = "value"), + div(b = "value") + ) + # NULL children are dropped expect_identical( renderTags(div("foo", NULL, list(NULL, list(NULL, "bar"))))$html, renderTags(div("foo", "bar"))$html ) + # length-0 children are dropped + expect_identical( + renderTags(div("foo", character(), list(character(), list(list(), "bar"))))$html, + renderTags(div("foo", "bar"))$html + ) + # Numbers are coerced to strings expect_identical( renderTags(div(1234))$html, @@ -590,7 +602,7 @@ expect_error(css(1, b=2)) # NULL and empty string are dropped - expect_identical(css(a="", b = NULL, "c!" = NULL), "") + expect_identical(css(a="", b = NULL, "c!" = NULL, d = character()), "") # We are dumb about duplicated properties. Probably don't do that. expect_identical(css(a=1, a=2), "a:1;a:2;") diff -Nru r-cran-htmltools-0.3.5/tests/testthat/test-template.R r-cran-htmltools-0.3.6/tests/testthat/test-template.R --- r-cran-htmltools-0.3.5/tests/testthat/test-template.R 2016-03-10 06:54:01.000000000 +0000 +++ r-cran-htmltools-0.3.6/tests/testthat/test-template.R 2017-04-26 23:49:08.000000000 +0000 @@ -46,6 +46,27 @@ expect_identical(charToRaw(text), as.raw(c(0xc3, 0xbf))) }) +test_that("UTF-8 characters in template head but not body", { + # On Windows, a string with "中文" will automatically be marked as UTF-8. + ui <- tagList( + tags$head(tags$script("alert('中文')")), + "test" + ) + html <- htmlTemplate("template-basic.html", body = ui) + res <- renderDocument(html) + expect_identical(Encoding(res), "UTF-8") + expect_true(grepl("中文", res, fixed = TRUE)) + + # On Windows, a string with "á" will automatically be marked as latin1. + ui <- tagList( + tags$head(tags$script("alert('á')")), + "test" + ) + html <- htmlTemplate("template-basic.html", body = ui) + res <- renderDocument(html) + expect_identical(Encoding(res), "UTF-8") + expect_true(grepl("á", res, fixed = TRUE)) +}) test_that("Dependencies are added properly", { dep <- htmlDependency("d3", "3.5.10", c(href="shared"), script = "d3.js")