Treat the text at the current position as a tag, and scan it. Supports
comments, doctype tags, and regular tags, and ignores less-than and
greater-than characters within quoted strings.
# File actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb, line 51
def scan_tag
tag = @scanner.getch
if @scanner.scan(/!--/) # comment
tag << @scanner.matched
tag << (@scanner.scan_until(/--\s*>/) || @scanner.scan_until(/\Z/))
elsif @scanner.scan(/!\[CDATA\[/)
tag << @scanner.matched
tag << (@scanner.scan_until(/\]\]>/) || @scanner.scan_until(/\Z/))
elsif @scanner.scan(/!/) # doctype
tag << @scanner.matched
tag << consume_quoted_regions
else
tag << consume_quoted_regions
end
tag
end