rstudio/shiny — pull request #126 by gmbecker (2013-03-17 22:27:28+00:00)
Title: Handlle HTML nodes from XML package

Hey guys,

I have written a renderHTML function which accepts raw HTML code, either in any form renderText can handle, or in the form of an XMLInternalNode (the representation for HTML in the XML package) and returns a string ready to be inserted directly into the output. I have included both documentation and unit tests for the new function, and the package builds, checks, and installs with no errors or warnings.

renderHTML is defined in such a way that if the XML package is not installed, it is a simple alias for renderText, whereas if it is installed the new function I wrote which handles the addition case of XMLInternalNode objects is used. Behavior for a non-XMLInternalNode object is always identical to that of renderText

This pull request will change 5 files:
**DESCRIPTION**: add XML to Suggests
**NAMESPACE**: export renderHTML function
**R/shinywrappers.R**: renderHTML function defined, including roxygen documentation comments
**inst/tests/test-text.R**: Added tests for renderHTML in the case of both character/tag objects (always run) and XMLInternalNodes (only run if XML is installed)
**man/renderHTML.Rd**: generated via roxygen2

No other additions were made and no existing R code or documentation was altered.

I hope you'll consider accepting this request. I already use this functionality myself but I think it belongs in the shiny package instead of the beginning of all my server.R files.

~G