We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 864a7b2 commit 9cfd255Copy full SHA for 9cfd255
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