require 'rdoc/markup/formatter' require 'rdoc/markup/inline' require 'cgi' ## # Outputs RDoc markup as HTML class RDoc::Markup::ToHtml < RDoc::Markup::Formatter include RDoc::Text # :section: Utilities ## # Maps RDoc::Markup::Parser::LIST_TOKENS types to HTML tags LIST_TYPE_TO_HTML = { :BULLET => ['
" @res << wrap(to_html(paragraph.text)) @res << "
\n" end ## # Adds +verbatim+ to the output def accept_verbatim(verbatim) @res << "\n"
@res << CGI.escapeHTML(verbatim.text.rstrip)
@res << "\n"
end
##
# Adds +rule+ to the output
def accept_rule(rule)
size = rule.weight
size = 10 if size > 10
@res << "#{to_html list_item.label}