Class: Rouge::Formatters::HTMLInline
- Inherits:
-
HTML
- Object
- Rouge::Formatter
- HTML
- Rouge::Formatters::HTMLInline
- Defined in:
- lib/rouge/formatters/html_inline.rb
Constant Summary
Constants inherited from Rouge::Formatter
Instance Method Summary collapse
-
#initialize(theme) ⇒ HTMLInline
constructor
A new instance of HTMLInline.
- #safe_span(tok, safe_val) ⇒ Object
Methods inherited from HTML
Methods inherited from Rouge::Formatter
find, format, #format, #render, #stream, tag
Constructor Details
#initialize(theme) ⇒ HTMLInline
Returns a new instance of HTMLInline.
6 7 8 |
# File 'lib/rouge/formatters/html_inline.rb', line 6 def initialize(theme) @theme = theme end |
Instance Method Details
#safe_span(tok, safe_val) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/rouge/formatters/html_inline.rb', line 10 def safe_span(tok, safe_val) return safe_val if tok == Token::Tokens::Text rules = @inline_theme.style_for(tok).rendered_rules "<span style=\"#{rules.to_a.join(';')}\">#{safe_val}</span>" end |