From 59b539ef43c9f6b1d751c947c5d34e8c39300e2e Mon Sep 17 00:00:00 2001 From: Josip Janzic Date: Sun, 11 Jun 2017 21:12:02 +0200 Subject: [PATCH] Make sure title is set if h_tag_title is empty --- lib/readability/title_finder.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/readability/title_finder.ex b/lib/readability/title_finder.ex index 1ce2da0..22c8d40 100644 --- a/lib/readability/title_finder.ex +++ b/lib/readability/title_finder.ex @@ -16,11 +16,12 @@ defmodule Readability.TitleFinder do case og_title(html_tree) do "" -> title = tag_title(html_tree) + h_title = h_tag_title(html_tree) - if good_title?(title) do + if good_title?(title) || h_title == "" do title else - h_tag_title(html_tree) + h_title end title when is_binary(title) -> title