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