Class: REHTML::Tokenizer
- Inherits:
-
Object
- Object
- REHTML::Tokenizer
- Defined in:
- lib/rehtml/tokenizer.rb
Instance Method Summary collapse
-
#initialize(html) ⇒ Tokenizer
constructor
Create a new Tokenizer for the given text.
-
#next ⇒ Object
Return the next token in the sequence, or
nilif there are no more tokens in the stream.
Constructor Details
Instance Method Details
#next ⇒ Object
Return the next token in the sequence, or nil if there are no more tokens in the stream.
24 25 26 27 |
# File 'lib/rehtml/tokenizer.rb', line 24 def next return nil if @scanner.eos? add_parse_info(@scanner.check(/<\S/) ? scan_element : scan_text) end |