8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32b0cf5 commit d9d6dd5Copy full SHA for d9d6dd5
lib/coderay/scanners/html.rb
@@ -99,7 +99,17 @@ def scan_tokens encoder, options
99
case state
100
101
when :initial
102
- if match = scan(/<!--(?:.*?-->|.*)/m)
+ if match = scan(/<!\[CDATA\[/)
103
+ encoder.begin_group :string
104
+ encoder.text_token match, :delimiter
105
+ if match = scan(/.*?\]\]>/m)
106
+ encoder.text_token match[0..-4], :content
107
+ encoder.text_token ']]>', :delimiter
108
+ else
109
+ encoder.text_token scan(/.*/m), :error
110
+ end
111
+ encoder.end_group :string
112
+ elsif match = scan(/<!--(?:.*?-->|.*)/m)
113
encoder.text_token match, :comment
114
elsif match = scan(/<!(\w+)(?:.*?>|.*)|\]>/m)
115
encoder.text_token match, :doctype
0 commit comments