Skip to content

Build your personal knowledge base with Trilium Notes

fix(clipper): look for a tag in linear time

Elian Doran0ab8cede1dcf
diff --git a/apps/server/src/routes/api/clipper.ts b/apps/server/src/routes/api/clipper.ts
index 091d43b063..6a23c498be 100644
--- a/apps/server/src/routes/api/clipper.ts
+++ b/apps/server/src/routes/api/clipper.ts
@@ -183,7 +183,7 @@ export async function processContent(images: Image[], note: BNote, content: stri
// fallback if parsing/downloading images fails for some reason on the extension side (
rewrittenContent = noteService.downloadImages(note.noteId, rewrittenContent);
// Check if rewrittenContent contains at least one HTML tag
- if (!/<.+?>/.test(rewrittenContent)) {
+ if (!/<[^<>]+>/.test(rewrittenContent)) {
rewrittenContent = `<p>${rewrittenContent}</p>`;
}
// Create a JSDOM object from the existing HTML content