convert   into whitespace also for large notes

This commit is contained in:
zadam 2020-12-25 12:55:16 +01:00
parent a266d6a3d5
commit 577dc95ab8
2 changed files with 10 additions and 10 deletions

View File

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

View File

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