Class: Nokogiri::HTML4::Document::EncodingReader::JumpSAXHandler
- Inherits:
-
SAXHandler
- Object
- XML::SAX::Document
- SAXHandler
- Nokogiri::HTML4::Document::EncodingReader::JumpSAXHandler
- Defined in:
- lib/nokogiri/html4/document.rb
Instance Attribute Summary
Attributes inherited from SAXHandler
Instance Method Summary collapse
-
#initialize(jumptag) ⇒ JumpSAXHandler
constructor
A new instance of JumpSAXHandler.
- #start_element(name, attrs = []) ⇒ Object
Methods inherited from XML::SAX::Document
#cdata_block, #characters, #comment, #end_document, #end_element, #end_element_namespace, #error, #processing_instruction, #start_document, #start_element_namespace, #warning, #xmldecl
Constructor Details
#initialize(jumptag) ⇒ JumpSAXHandler
Returns a new instance of JumpSAXHandler.
258 259 260 261 |
# File 'lib/nokogiri/html4/document.rb', line 258 def initialize(jumptag) @jumptag = jumptag super() end |
Instance Method Details
#start_element(name, attrs = []) ⇒ Object
263 264 265 266 267 |
# File 'lib/nokogiri/html4/document.rb', line 263 def start_element(name, attrs = []) super throw(@jumptag, @encoding) if @encoding throw(@jumptag, nil) if /\A(?:div|h1|img|p|br)\z/.match?(name) end |