class Rouge::Formatters::Terminal256::Unescape
Public Class Methods
Public Instance Methods
Source
# File lib/rouge/formatters/terminal256.rb, line 172 def escape_sequence(token) return Unescape.new if escape?(token) @escape_sequences ||= {} @escape_sequences[token.qualname] ||= make_escape_sequence(get_style(token)) end
private
Source
# File lib/rouge/formatters/terminal256.rb, line 183 def get_style(token) return text_style if token.ancestors.include? Token::Tokens::Text theme.get_own_style(token) || text_style end
Source
# File lib/rouge/formatters/terminal256.rb, line 179 def make_escape_sequence(style) EscapeSequence.new(style) end
Source
# File lib/rouge/formatters/terminal256.rb, line 167 def reset_string(*) '' end
Source
# File lib/rouge/formatters/terminal256.rb, line 168 def stream_value(val) yield val end end
Source
# File lib/rouge/formatters/terminal256.rb, line 166 def style_string(*) '' end
Source
# File lib/rouge/formatters/terminal256.rb, line 189 def text_style style = theme.get_style(Token['Text']) # don't highlight text backgrounds style.delete :bg style end