summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:13:15 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:13:15 +0200
commit14f3a4f28341237503a51bfa0764c922bb02bdfa (patch)
tree7b1fdc4ed3591b6b119107e3ed2ec338ae65d967
parent1d445c70edf8d5c878f9a830dcd29f5a3e179923 (diff)
downloadcoderay-14f3a4f28341237503a51bfa0764c922bb02bdfa.tar.gz
tweak HTML CDATA token kinds
-rw-r--r--lib/coderay/scanners/html.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/coderay/scanners/html.rb b/lib/coderay/scanners/html.rb
index fcf249a..530ce44 100644
--- a/lib/coderay/scanners/html.rb
+++ b/lib/coderay/scanners/html.rb
@@ -1,13 +1,13 @@
module CodeRay
module Scanners
-
+
# HTML Scanner
#
# Alias: +xhtml+
#
# See also: Scanners::XML
class HTML < Scanner
-
+
register_for :html
KINDS_NOT_LOC = [
@@ -100,15 +100,13 @@ module Scanners
when :initial
if match = scan(/<!\[CDATA\[/)
- encoder.begin_group :string
- encoder.text_token match, :delimiter
+ encoder.text_token match, :inline_delimiter
if match = scan(/.*?\]\]>/m)
- encoder.text_token match[0..-4], :content
- encoder.text_token ']]>', :delimiter
- else
- encoder.text_token scan(/.*/m), :error
+ encoder.text_token match[0..-4], :plain
+ encoder.text_token ']]>', :inline_delimiter
+ elsif match = scan(/.+/)
+ encoder.text_token match, :error
end
- encoder.end_group :string
elsif match = scan(/<!--(?:.*?-->|.*)/m)
encoder.text_token match, :comment
elsif match = scan(/<!(\w+)(?:.*?>|.*)|\]>/m)