提交 e600b3a3 编写于 作者: T Timm

Changed conditional check in filter. Removed weird comments.

上级 4b55c0aa
......@@ -341,16 +341,12 @@ def filter(matches)
content.strip! unless NO_STRIP.include?(match.name)
content.sub!(/\A\n/, '') if text_matches && match.name == "textarea"
unless match_with.is_a?(Regexp) ? (content =~ match_with) : (content == match_with.to_s)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, content)
true
end
next if match_with.is_a?(Regexp) ? (content =~ match_with) : (content == match_with.to_s)
content_mismatch ||= sprintf("<%s> expected but was\n<%s>.", match_with, content)
true
end
# Expecting foo found bar element only if found zero, not if
# found one but expecting two.
self.message ||= content_mismatch if remaining.empty?
Nokogiri::XML::NodeSet.new(matches.document, remaining)
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册