From 8aaee2c40ca8d4f983c2cc15e668b0a64d95b0d6 Mon Sep 17 00:00:00 2001 From: wellCh4n Date: Sat, 15 Feb 2025 16:48:21 +0800 Subject: [PATCH] feat(app): support complex title --- src/utils/documents.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/documents.ts b/src/utils/documents.ts index 5cd0366..3656689 100644 --- a/src/utils/documents.ts +++ b/src/utils/documents.ts @@ -65,7 +65,7 @@ export const getDocumentsFromLinks = async ({ links }: { links: string[] }) => { const splittedText = await splitter.splitText(parsedText); const title = res.data .toString('utf8') - .match(/(.*?)<\/title>/)?.[1]; + .match(/<title.*>(.*?)<\/title>/)?.[1]; const linkDocs = splittedText.map((text) => { return new Document({