Use Whitelist for LITERAL_HTML_ELEMENTS

This commit is contained in:
Yorick Peterse 2015-05-17 21:56:38 +02:00
parent ca16a2976e
commit 596a9b18d6
2 changed files with 2 additions and 2 deletions

View File

@ -87,7 +87,7 @@ module Oga
## ##
# Names of HTML tags of which the content should be lexed as-is. # Names of HTML tags of which the content should be lexed as-is.
# #
LITERAL_HTML_ELEMENTS = NodeNameSet.new([HTML_SCRIPT, HTML_STYLE]) LITERAL_HTML_ELEMENTS = Whitelist.new([HTML_SCRIPT, HTML_STYLE])
## ##
# @param [String|IO] data The data to lex. This can either be a String or # @param [String|IO] data The data to lex. This can either be a String or

View File

@ -59,7 +59,7 @@ module Oga
node = parent node = parent
return node.is_a?(Element) && html? && return node.is_a?(Element) && html? &&
Lexer::LITERAL_HTML_ELEMENTS.include?(node.name) Lexer::LITERAL_HTML_ELEMENTS.allow?(node.name)
end end
end # Text end # Text
end # XML end # XML