Skip to content

Commit

Permalink
Merge pull request #154 from joneswah/title-fix
Browse files Browse the repository at this point in the history
Only extract the Title in the HEAD element
  • Loading branch information
ospfranco authored Oct 21, 2024
2 parents a50e40b + 1c6ded9 commit 3eda47c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getTitle(doc: cheerio.Root) {
metaTagContent(doc, `og:title`, `property`) ||
metaTagContent(doc, `og:title`, `name`);
if (!title) {
title = doc(`title`).text();
title = doc(`head > title`).text();
}
return title;
}
Expand Down

0 comments on commit 3eda47c

Please sign in to comment.