method
accept_verbatim
v2_2_9 -
Show latest stable
- Class:
RDoc::Markup::ToHtml
accept_verbatim(verbatim)public
Adds verbatim to the output
# File lib/rdoc/markup/to_html.rb, line 195
def accept_verbatim verbatim
text = verbatim.text.rstrip
klass = nil
content = if verbatim.ruby? or parseable? text then
begin
tokens = RDoc::RubyLex.tokenize text, @options
klass = ' class="ruby"'
RDoc::TokenStream.to_html tokens
rescue RDoc::RubyLex::Error
CGI.escapeHTML text
end
else
CGI.escapeHTML text
end
if @options.pipe then
@res << "\n<pre><code>#{CGI.escapeHTML text}</code></pre>\n"
else
@res << "\n<pre#{klass}>#{content}</pre>\n"
end
end Related methods
- Instance methods
- accept_blank_line
- accept_block_quote
- accept_heading
- accept_list_end
- accept_list_item_end
- accept_list_item_start
- accept_list_start
- accept_paragraph
- accept_raw
- accept_rule
- accept_verbatim
- convert_string
- end_accepting
- gen_url
- handle_RDOCLINK
- handle_special_HARD_BREAK
- handle_special_HYPERLINK
- handle_special_RDOCLINK
- handle_special_TIDYLINK
- html_list_name
- init_tags
- list_end_for
- list_item_start
- parseable?
- start_accepting
- to_html
- Class methods
- new