Module Raggle::HTML::Parser
In: raggle  (CVS)

Basic HTML parser.

Methods

Constants

NO_ATTRIBUTES = {}.freeze
ATTRIBUTE_LIST_RE = /\s*([^>=\s]+)\s*(?:=\s*(?:(?:['"]([^'">]*)['"])|([^'"\s>]+)))?/
PARSER_RE = %r!<(/?\w+[^>]*?/?)>|([^<]*)!m

Public Class methods

Parses HTML in source and invokes block with each token as a paramater.

Parameters to the block:

 token id   | data        | attributes
 :TEXT      | text        | NO_ATTRIBUTES
 :START_TAG | tag's name  | attributes of current tag
 :END_TAG   | tag's name  | NO_ATTRIBUTES
source:HTML source

Parses tag’s attributes and returns them in a hash.

[Validate]