Make sure title is set if h_tag_title is empty

This commit is contained in:
Josip Janzic 2017-06-11 21:12:02 +02:00
parent 93955d36d2
commit 59b539ef43
No known key found for this signature in database
GPG Key ID: 210BC3C60D619EEE
1 changed files with 3 additions and 2 deletions

View File

@ -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