HTML documents can be beautiful and pristine. They can also be wretched, evil, malformed demon-spawn. Now, you can tidy up that HTML and XHTML before processing it with your favorite angle-bracket crunching tools, going beyond the limited tidying that 'libxml2' affords in the 'XML' and 'xml2' packages and taming even the ugliest HTML code generated by the likes of Google Docs and Microsoft Word. It's also possible to use the functions provided to format or "pretty print" HTML content as it is being tidied. Utilities are also included that make it possible to view formatted and "pretty printed" HTML/XML content from HTML/XML document objects, nodes, node sets and plain character HTML/XML using 'vkbeautify' (by Vadim Kiryukhin) and 'highlight.js' (by Ivan Sagalaev). Also (optionally) enables filtering of nodes via XPath or viewing an HTML/XML document in "tree" view using 'xml-viewer' (by Julian Gruber). See and for more information about 'vkbeautify' and 'xml-viewer', respectively.

Documentation

Manual: htmltidy.pdf
Vignette: None available.

Maintainer: Bob Rudis <bob at rud.is>

Author(s): Bob Rudis*, Dave Raggett* (Original HTML Tidy library), Charles Reitzel* (Modern HTML Tidy library), Björn Höhrmann* (HTML5 Support), Kenton Russell* (xml-viewer integration), Vadim Kiryukhin* (vkbeautify library), Ivan Sagalaev* (highlight.js library), Julian Gruber* (xml-viewer library)

Install package and any missing dependencies by running this line in your R console:

install.packages("htmltidy")

Depends R (>= 3.2.0)
Imports Rcpp, xml2, XML, htmlwidgets, htmltools
Suggests testthat, httr, rvest
Enhances
Linking to Rcpp
Reverse
depends
Reverse
imports
Reverse
suggests
Reverse
enhances
Reverse
linking to

Package htmltidy
Materials
URL https://github.com/hrbrmstr/htmltidy
Task Views
Version 0.3.1
Published 2017-02-02
License MIT + file LICENSE
BugReports https://github.com/hrbrmstr/htmltidy/issues
SystemRequirements
NeedsCompilation yes
Citation
CRAN checks htmltidy check results
Package source htmltidy_0.3.1.tar.gz