From 9975fcb5c2c59f6aa02040e281b55d904e77d22d Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 9 Sep 2011 00:52:01 +0200 Subject: HTML scanner ignores <% tags and accepts :state option --- lib/coderay/scanners/html.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/coderay/scanners') 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 -- cgit v1.2.1