From 8ea3608bf1dd4b66e3f5c678d3b8f3e56b211005 Mon Sep 17 00:00:00 2001 From: zadam Date: Tue, 29 Nov 2022 00:00:45 +0100 Subject: [PATCH] each stripped tag will be replace by a space, #3355 --- src/services/search/expressions/note_content_fulltext.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/search/expressions/note_content_fulltext.js b/src/services/search/expressions/note_content_fulltext.js index 548578c2b..e6c182ed6 100644 --- a/src/services/search/expressions/note_content_fulltext.js +++ b/src/services/search/expressions/note_content_fulltext.js @@ -100,7 +100,7 @@ class NoteContentFulltextExp extends Expression { if (type === 'text' && mime === 'text/html') { if (!this.raw && content.length < 20000) { // striptags is slow for very large notes // allow link to preserve URLs: https://github.com/zadam/trilium/issues/2412 - content = striptags(content, ['a']); + content = striptags(content, ['a'], ' '); // at least the closing tag can be easily stripped content = content.replace(/<\/a>/ig, "");