1
###########################################################################/**
2
# @RdocClass HtmlRspLanguage
3
#
4
# @title "The HtmlRspLanguage class"
5
#
6
# \description{
7
#  @classhierarchy
8
# }
9
#
10
# @synopsis
11
#
12
# \arguments{
13
#   \item{...}{Arguments passed to the constructor of the @see "RspLanguage".}
14
# }
15
#
16
# \section{Fields and Methods}{
17
#  @allmethods
18
# }
19
#
20
# @author
21
#
22
# @keyword internal
23
#*/###########################################################################
24
setConstructorS3("HtmlRspLanguage", function(...) {
25 1
  extend(RspLanguage(language="html", ...), "HtmlRspLanguage")
26
})
27

28

29
setMethodS3("getComment", "HtmlRspLanguage", function(object, ...) {
30 0
  s <- paste(..., collapse="\n", sep="")
31 0
  s <- paste("<!-- ", s, " -->", sep="")
32 0
  s
33
})
34

35

36
setMethodS3("escape", "HtmlRspLanguage", function(object, ...) {
37 0
  s <- paste(..., collapse="\n", sep="")
38 0
  s <- gsub("<", "&lt;", s)
39 0
  s <- gsub(">", "&gt;", s)
40 0
  s
41
})
42

43

44
setMethodS3("getVerbatim", "HtmlRspLanguage", function(object, ..., newline=NULL) {
45 0
  s <- NextMethod("getVerbatim", newline="")
46 0
  if (is.null(newline))
47 0
    newline <- getNewline(object)
48 0
  if (is.character(newline)) {
49 0
    s <- gsub("\n\r|\r\n|\r", "\n", s)
50 0
    s <- gsub("\n", newline, s)
51
  }
52 0
  s
53
})

Read our documentation on viewing source code .

Loading