From 596a9b18d6ad7531e5303e6050bea41434256afd Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sun, 17 May 2015 21:56:38 +0200 Subject: [PATCH] Use Whitelist for LITERAL_HTML_ELEMENTS --- lib/oga/xml/lexer.rb | 2 +- lib/oga/xml/text.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/oga/xml/lexer.rb b/lib/oga/xml/lexer.rb index dabbbaf..4c38c50 100644 --- a/lib/oga/xml/lexer.rb +++ b/lib/oga/xml/lexer.rb @@ -87,7 +87,7 @@ module Oga ## # 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 diff --git a/lib/oga/xml/text.rb b/lib/oga/xml/text.rb index a9eb796..a6bbb50 100644 --- a/lib/oga/xml/text.rb +++ b/lib/oga/xml/text.rb @@ -59,7 +59,7 @@ module Oga node = parent return node.is_a?(Element) && html? && - Lexer::LITERAL_HTML_ELEMENTS.include?(node.name) + Lexer::LITERAL_HTML_ELEMENTS.allow?(node.name) end end # Text end # XML