Class: CodeRay::Scanners::HTML

Inherits:
Scanner
  • Object
show all
Includes:
CodeRay::Streamable
Defined in:
lib/coderay/scanners/html.rb

Overview

HTML Scanner

Direct Known Subclasses

XML

Constant Summary collapse

KINDS_NOT_LOC =
[
  :comment, :doctype, :preprocessor,
  :tag, :attribute_name, :operator,
  :attribute_value, :delimiter, :content,
  :plain, :entity, :error
]
ATTR_NAME =
/[\w.:-]+/
ATTR_VALUE_UNQUOTED =
ATTR_NAME
TAG_END =
/\/?>/
HEX =
/[0-9a-fA-F]/
ENTITY =
/
  &
  (?:
    \w+
  |
    \#
    (?:
      \d+
    |
      x#{HEX}+
    )
  )
  ;
/ox
PLAIN_STRING_CONTENT =
{
  "'" => /[^&'>\n]+/,
  '"' => /[^&">\n]+/,
}

Constants inherited from Scanner

Scanner::DEFAULT_OPTIONS, Scanner::ScanError

Instance Method Summary collapse

Methods inherited from Scanner

#column, #each, file_extension, #initialize, #line, #marshal_dump, #marshal_load, normify, streamable?, #streaming?, #string=, #tokenize, #tokens

Methods included from Plugin

#helper, #included, #plugin_host, #plugin_id, #register_for, #title

Constructor Details

This class inherits a constructor from CodeRay::Scanners::Scanner

Instance Method Details

#resetObject



41
42
43
44
# File 'lib/coderay/scanners/html.rb', line 41

def reset
  super
  @state = :initial
end