Added a convenience class for parsing HTML.
This removes the need for users having to set the `:html` option themselves.
This commit is contained in:
1 parent
58009614f6
commit
79818eb349
4 files changed
+42
-1
No files matched your search
@@ -1,5 +1,8 @@
|
||||
require 'ast'
|
||||
|
||||
require_relative 'oga/ast/node'
|
||||
|
||||
require_relative 'oga/xml/lexer'
|
||||
require_relative 'oga/xml/parser'
|
||||
|
||||
require_relative 'oga/html/parser'
|
||||
@@ -0,0 +1,19 @@
|
||||
module Oga
|
||||
module HTML
|
||||
##
|
||||
# Low level AST parser for parsing HTML documents. See {Oga::XML::Parser}
|
||||
# for more information.
|
||||
#
|
||||
class Parser < XML::Parser
|
||||
##
|
||||
# @param [Hash] options
|
||||
# @see Oga::XML::Parser#initialize
|
||||
#
|
||||
def initialize(options = {})
|
||||
options = options.merge(:html => true)
|
||||
|
||||
super(options)
|
||||
end
|
||||
end # Parser
|
||||
end # HTML
|
||||
end # Oga
|
||||
Reference in new issue
Block a user