Bug fix with empty titles
The code for title retrieval previously assumed that meta tags concerned with the title would always contain a value but some sites leave the value empty thus it had to be checked for as well.
This commit is contained in:
parent
65fdd967c1
commit
f0a610c2ac
1 changed files with 6 additions and 1 deletions
|
@ -462,7 +462,12 @@ impl Readability {
|
|||
.iter()
|
||||
.find(|key| values.contains_key(**key))
|
||||
{
|
||||
values.get(*key).map(|title| title.to_owned()).unwrap()
|
||||
let title = values.get(*key).map(|title| title.to_owned()).unwrap();
|
||||
if title.is_empty() {
|
||||
self.get_article_title()
|
||||
} else {
|
||||
title
|
||||
}
|
||||
} else {
|
||||
self.get_article_title()
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue