lib/rouge/formatter.rb in rouge-3.4.1 vs lib/rouge/formatter.rb in rouge-3.5.0

- old
+ new

@@ -27,11 +27,11 @@ ensure Thread.current[:'rouge/with-escape'] = false end def self.escape_enabled? - !!(@escape_enabled || Thread.current[:'rouge/with-escape']) + !!(((defined? @escape_enabled) && @escape_enabled) || Thread.current[:'rouge/with-escape']) end def self.enable_escape! @escape_enabled = true end @@ -92,10 +92,10 @@ def token_lines(tokens, &b) return enum_for(:token_lines, tokens) unless block_given? out = [] tokens.each do |tok, val| - val.scan /\n|[^\n]+/ do |s| + val.scan %r/\n|[^\n]+/ do |s| if s == "\n" yield out out = [] else out << [tok, s]