Added XML::Node#html? and XML::Node#xml?
The former has been moved over from XML::Text, the latter just inverts html?.
This commit is contained in:
1 parent
4ad502958d
commit
b6fcd326ef
3 files changed
+48
-11
No files matched your search
@@ -163,6 +163,22 @@ module Oga
|
||||
|
||||
node_set.insert(index, other)
|
||||
end
|
||||
|
||||
##
|
||||
# @return [TrueClass|FalseClass]
|
||||
#
|
||||
def html?
|
||||
root = root_node
|
||||
|
||||
return root.is_a?(Document) && root.html?
|
||||
end
|
||||
|
||||
##
|
||||
# @return [TrueClass|FalseClass]
|
||||
#
|
||||
def xml?
|
||||
return !html?
|
||||
end
|
||||
end # Element
|
||||
end # XML
|
||||
end # Oga
|
||||
@@ -48,17 +48,6 @@ module Oga
|
||||
|
||||
return Entities.encode(super)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
##
|
||||
# @return [TrueClass|FalseClass]
|
||||
#
|
||||
def html?
|
||||
root = root_node
|
||||
|
||||
return root.is_a?(Document) && root.html?
|
||||
end
|
||||
end # Text
|
||||
end # XML
|
||||
end # Oga
|
||||
Reference in new issue
Block a user