lib/html2rss/auto_source/scraper/semantic_html/extractor.rb in html2rss-0.13.0 vs lib/html2rss/auto_source/scraper/semantic_html/extractor.rb in html2rss-0.14.0
- old
+ new
@@ -72,10 +72,10 @@
end
def find_heading
heading_tags = article_tag.css(HEADING_TAGS.join(',')).group_by(&:name)
smallest_heading = heading_tags.keys.min
- heading_tags[smallest_heading]&.max_by { |tag| tag.text.size }
+ heading_tags[smallest_heading]&.max_by { |tag| visible_text_from_tag(tag)&.size }
end
def extract_title
@extract_title ||= if heading.children.empty? && heading.text
visible_text_from_tag(heading)