don't strip tags for very large text notes, #1500

This commit is contained in:
zadam 2020-12-24 23:33:42 +01:00
parent b0b2951ff6
commit 749b6cb57e
2 changed files with 8 additions and 2 deletions

View File

@ -42,7 +42,10 @@ class NoteContentProtectedFulltextExp extends Expression {
content = content.toLowerCase();
if (type === 'text' && mime === 'text/html') {
if (type === 'text'
&& mime === 'text/html'
&& content.length < 50000 // striptags is very slow for large notes
) {
content = striptags(content);
content = content.replace(/&nbsp;/g, ' ');
}

View File

@ -28,7 +28,10 @@ class NoteContentUnprotectedFulltextExp extends Expression {
content = content.toString().toLowerCase();
if (type === 'text' && mime === 'text/html') {
if (type === 'text'
&& mime === 'text/html'
&& content.length < 50000 // striptags is very slow for large notes
) {
content = striptags(content);
content = content.replace(/&nbsp;/g, ' ');
}