Class: Nokogiri::HTML4::Document::EncodingReader::JumpSAXHandler

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

Overview

Since:

  • v1.12.0

Instance Method Summary collapse

Constructor Details

#initialize(jumptag) ⇒ JumpSAXHandler

Returns a new instance of JumpSAXHandler.

Since:

  • v1.12.0



251
252
253
254
# File 'lib/nokogiri/html4/document.rb', line 251

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

Instance Method Details

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

Since:

  • v1.12.0



256
257
258
259
260
# File 'lib/nokogiri/html4/document.rb', line 256

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