each stripped tag will be replace by a space, #3355

This commit is contained in:
zadam 2022-11-29 00:00:45 +01:00
parent ee667634ab
commit 8ea3608bf1

View File

@ -100,7 +100,7 @@ class NoteContentFulltextExp extends Expression {
if (type === 'text' && mime === 'text/html') { if (type === 'text' && mime === 'text/html') {
if (!this.raw && content.length < 20000) { // striptags is slow for very large notes 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 // 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 // at least the closing tag can be easily stripped
content = content.replace(/<\/a>/ig, ""); content = content.replace(/<\/a>/ig, "");