diff options
Diffstat (limited to 'lib/coderay/scanners/html.rb')
-rw-r--r-- | lib/coderay/scanners/html.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb index 206ace0..fcf89cb 100644 --- a/lib/coderay/scanners/html.rb +++ b/lib/coderay/scanners/html.rb @@ -58,9 +58,10 @@ module Scanners '"' => /[^&">\n]+/, } # :nodoc: - def reset_instance # :nodoc: + def reset super @state = :initial + @plain_string_content = nil end protected @@ -80,11 +81,12 @@ module Scanners end def scan_tokens encoder, options - state = @state plain_string_content = @plain_string_content in_tag = in_attribute = nil + encoder.begin_group :string if state == :attribute_value_string + until eos? if state != :in_special_tag && match = scan(/\s+/m) @@ -238,12 +240,10 @@ module Scanners if options[:keep_state] @state = state @plain_string_content = plain_string_content - else - if state == :attribute_value_string - encoder.end_group :string - end end + encoder.end_group :string if state == :attribute_value_string + encoder end |