class Rouge::Formatters::HTML
Transforms a token stream into HTML output.
def safe_span(tok, safe_val)
def safe_span(tok, safe_val) if tok == Token::Tokens::Text safe_val else shortname = tok.shortname \ or raise "unknown token: #{tok.inspect} for #{safe_val.inspect}" "<span class=\"#{shortname}\">#{safe_val}</span>" end end
def span(tok, val)
def span(tok, val) safe_span(tok, val.gsub(/[&<>]/, TABLE_FOR_ESCAPE_HTML)) end
def stream(tokens, &b)
- Yield: - the html output.
def stream(tokens, &b) tokens.each { |tok, val| yield span(tok, val) } end