Merge pull request #996 from mendableai/fix/title-extra-info

[BUG] fixed title extra info
This commit is contained in:
Nicolas 2024-12-19 16:05:49 -03:00 committed by GitHub
commit ed24853ca6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,7 @@ export function extractMetadata(
const soup = load(html);
try {
title = soup("title").text() || undefined;
title = soup("title").first().text().trim() || undefined;
description = soup('meta[name="description"]').attr("content") || undefined;
// Assuming the language is part of the URL as per the regex pattern