Skip to content

Commit 9975fcb

Browse files
committed
HTML scanner ignores <% tags and accepts :state option
1 parent 9a2edcc commit 9975fcb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/coderay/scanners/html.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def scan_java_script encoder, code
8181
end
8282

8383
def scan_tokens encoder, options
84-
state = @state
84+
state = options[:state] || @state
8585
plain_string_content = @plain_string_content
8686
in_tag = in_attribute = nil
8787

@@ -103,7 +103,7 @@ def scan_tokens encoder, options
103103
encoder.text_token match, :doctype
104104
elsif match = scan(/<\?xml(?:.*?\?>|.*)/m)
105105
encoder.text_token match, :preprocessor
106-
elsif match = scan(/<\?(?:.*?\?>|.*)|<%(?:.*?%>|.*)/m)
106+
elsif match = scan(/<\?(?:.*?\?>|.*)/m)
107107
encoder.text_token match, :comment
108108
elsif match = scan(/<\/[-\w.:]*>?/m)
109109
in_tag = nil

0 commit comments

Comments
 (0)