File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1
1
module CodeRay
2
2
module Scanners
3
-
3
+
4
4
# HTML Scanner
5
5
#
6
6
# Alias: +xhtml+
7
7
#
8
8
# See also: Scanners::XML
9
9
class HTML < Scanner
10
-
10
+
11
11
register_for :html
12
12
13
13
KINDS_NOT_LOC = [
@@ -100,15 +100,13 @@ def scan_tokens encoder, options
100
100
101
101
when :initial
102
102
if match = scan ( /<!\[ CDATA\[ / )
103
- encoder . begin_group :string
104
- encoder . text_token match , :delimiter
103
+ encoder . text_token match , :inline_delimiter
105
104
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
105
+ encoder . text_token match [ 0 ..-4 ] , :plain
106
+ encoder . text_token ']]>' , :inline_delimiter
107
+ elsif match = scan ( /.+/ )
108
+ encoder . text_token match , :error
110
109
end
111
- encoder . end_group :string
112
110
elsif match = scan ( /<!--(?:.*?-->|.*)/m )
113
111
encoder . text_token match , :comment
114
112
elsif match = scan ( /<!(\w +)(?:.*?>|.*)|\] >/m )
You can’t perform that action at this time.
0 commit comments