Class: Nokogiri::HTML::Document::EncodingReader::JumpSAXHandler

Inherits:
SAXHandler show all
Defined in:
lib/nokogiri/html/document.rb

Instance Method Summary collapse

Constructor Details

#initialize(jumptag) ⇒ JumpSAXHandler

Returns a new instance of JumpSAXHandler.



242
243
244
245
# File 'lib/nokogiri/html/document.rb', line 242

def initialize(jumptag)
  @jumptag = jumptag
  super()
end

Instance Method Details

#start_element(name, attrs = []) ⇒ Object



247
248
249
250
251
# File 'lib/nokogiri/html/document.rb', line 247

def start_element(name, attrs = [])
  super
  throw @jumptag, @encoding if @encoding
  throw @jumptag, nil if name =~ /\A(?:div|h1|img|p|br)\z/
end