Added XML::Document#html?
This commit is contained in:
1 parent
ba2177e2cf
commit
9a586363e9
3 files changed
+18
-1
No files matched your search
@@ -77,6 +77,13 @@ module Oga
|
||||
return xml
|
||||
end
|
||||
|
||||
##
|
||||
# @return [TrueClass|FalseClass]
|
||||
#
|
||||
def html?
|
||||
return type == :html
|
||||
end
|
||||
|
||||
##
|
||||
# Inspects the document and its child nodes. Child nodes are indented for
|
||||
# each nesting level.
|
||||
|
||||
@@ -307,7 +307,7 @@ module Oga
|
||||
self_closing = children.empty?
|
||||
root = root_node
|
||||
|
||||
if root.is_a?(Document) and root.type == :html \
|
||||
if root.is_a?(Document) and root.html? \
|
||||
and !HTML_VOID_ELEMENTS.include?(name)
|
||||
self_closing = false
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user