4dd70af5ae
Synced with latest version of HTML5lib, which fixes problem with Astral plane characters. I should really do some tests, but the HTML5lib Sanitizer seems to be 2-5 times slower than the old sanitizer.
22 lines
525 B
Ruby
22 lines
525 B
Ruby
module HTML5lib
|
|
module TreeBuilders
|
|
|
|
def self.getTreeBuilder(name)
|
|
case name.to_s.downcase
|
|
when 'simpletree' then
|
|
require 'html5lib/treebuilders/simpletree'
|
|
SimpleTree::TreeBuilder
|
|
when 'rexml' then
|
|
require 'html5lib/treebuilders/rexml'
|
|
REXMLTree::TreeBuilder
|
|
when 'hpricot' then
|
|
require 'html5lib/treebuilders/hpricot'
|
|
Hpricot::TreeBuilder
|
|
else
|
|
raise "Unknown TreeBuilder #{name}"
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|