1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
###########################################################################/**
# @RdocClass HtmlRspLanguage
#
# @title "The HtmlRspLanguage class"
#
# \description{
# @classhierarchy
# }
#
# @synopsis
#
# \arguments{
# \item{...}{Arguments passed to the constructor of the @see "RspLanguage".}
# }
#
# \section{Fields and Methods}{
# @allmethods
# }
#
# @author
#
# @keyword internal
#*/###########################################################################
setConstructorS3("HtmlRspLanguage", function(...) {
extend(RspLanguage(language="html", ...), "HtmlRspLanguage")
})
setMethodS3("getComment", "HtmlRspLanguage", function(object, ...) {
s <- paste(..., collapse="\n", sep="")
s <- paste("<!-- ", s, " -->", sep="")
s
})
setMethodS3("escape", "HtmlRspLanguage", function(object, ...) {
s <- paste(..., collapse="\n", sep="")
s <- gsub("<", "<", s)
s <- gsub(">", ">", s)
s
})
setMethodS3("getVerbatim", "HtmlRspLanguage", function(object, ..., newline=NULL) {
s <- NextMethod("getVerbatim", newline="")
if (is.null(newline))
newline <- getNewline(object)
if (is.character(newline)) {
s <- gsub("\n\r|\r\n|\r", "\n", s)
s <- gsub("\n", newline, s)
}
s
})
|