Class BeautifulStoneSoup
In: lib/rdig/content_extractors/rubyful_soup.rb
Parent: Object

override some methods concered with entity resolving to convert them to strings

Methods

External Aliases

unknown_entityref -> orig_unknown_entityref
  resolve unknown html entities using the htmlentities lib

Public Instance methods

resolve numeric entities to utf8

[Source]

    # File lib/rdig/content_extractors/rubyful_soup.rb, line 22
22:   def handle_charref(ref)
23:     handle_data( ref.gsub(/([0-9]{1,7})/) { 
24:                             [$1.to_i].pack('U') 
25:                     }.gsub(/x([0-9a-f]{1,6})/i) { 
26:                             [$1.to_i(16)].pack('U') 
27:                     } )
28:   end

[Source]

    # File lib/rdig/content_extractors/rubyful_soup.rb, line 13
13:   def unknown_entityref(ref)
14:     if HTMLEntities::MAP.has_key?(ref)
15:       handle_data [HTMLEntities::MAP[ref]].pack('U')
16:     else
17:       orig_unknown_entityref ref
18:     end
19:   end

[Validate]