FIX: Quotes should be ignored when parsing for onebox source.

This commit is contained in:
Guo Xiang Tan
2017-04-11 15:13:21 +08:00
parent 0a4c30bce3
commit 3861bd2793
2 changed files with 20 additions and 8 deletions

View File

@ -85,7 +85,11 @@ class ExcerptParser < Nokogiri::XML::SAX::Document
end
when "aside"
@in_quote = true unless @keep_onebox_source
attributes = Hash[*attributes.flatten]
unless @keep_onebox_source && attributes['class'].include?('onebox')
@in_quote = true
end
when 'article'
if @keep_onebox_source && attributes.include?(['class', 'onebox-body'])
@in_quote = true