summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2011-09-09 00:52:01 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2011-09-09 00:52:01 +0200
commit9975fcb5c2c59f6aa02040e281b55d904e77d22d (patch)
treee54eb23cd045ddbbfb8a15cd52158b602d0b4358
parent9a2edcce88880766825f46ae3725c90e9f6be3a8 (diff)
downloadcoderay-9975fcb5c2c59f6aa02040e281b55d904e77d22d.tar.gz
HTML scanner ignores <% tags and accepts :state option
-rw-r--r--lib/coderay/scanners/html.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb
index fcf89cb..98d06fc 100644
--- a/lib/coderay/scanners/html.rb
+++ b/lib/coderay/scanners/html.rb
@@ -81,7 +81,7 @@ module Scanners
end
def scan_tokens encoder, options
- state = @state
+ state = options[:state] || @state
plain_string_content = @plain_string_content
in_tag = in_attribute = nil
@@ -103,7 +103,7 @@ module Scanners
encoder.text_token match, :doctype
elsif match = scan(/<\?xml(?:.*?\?>|.*)/m)
encoder.text_token match, :preprocessor
- elsif match = scan(/<\?(?:.*?\?>|.*)|<%(?:.*?%>|.*)/m)
+ elsif match = scan(/<\?(?:.*?\?>|.*)/m)
encoder.text_token match, :comment
elsif match = scan(/<\/[-\w.:]*>?/m)
in_tag = nil