Skip to content

Build your personal knowledge base with Trilium Notes

convert   into whitespace also for large notes

zadam577dc95ab83b
diff --git a/src/services/search/expressions/note_content_protected_fulltext.js b/src/services/search/expressions/note_content_protected_fulltext.js
index d248385479..daed140002 100644
--- a/src/services/search/expressions/note_content_protected_fulltext.js
+++ b/src/services/search/expressions/note_content_protected_fulltext.js
@@ -42,11 +42,11 @@ class NoteContentProtectedFulltextExp extends Expression {
content = content.toLowerCase();
- if (type === 'text'
- && mime === 'text/html'
- && content.length < 20000 // striptags is very slow for large notes
- ) {
- content = striptags(content);
+ if (type === 'text' && mime === 'text/html') {
+ if (content.length < 20000) { // striptags is slow for very large notes
+ content = striptags(content);
+ }
+
content = content.replace(/&nbsp;/g, ' ');
}
diff --git a/src/services/search/expressions/note_content_unprotected_fulltext.js b/src/services/search/expressions/note_content_unprotected_fulltext.js
index 7f8df513fc..ad0ce7cdfa 100644
--- a/src/services/search/expressions/note_content_unprotected_fulltext.js
+++ b/src/services/search/expressions/note_content_unprotected_fulltext.js
@@ -28,11 +28,11 @@ class NoteContentUnprotectedFulltextExp extends Expression {
content = content.toString().toLowerCase();
- if (type === 'text'
- && mime === 'text/html'
- && content.length < 20000 // striptags is very slow for large notes
- ) {
- content = striptags(content);
+ if (type === 'text' && mime === 'text/html') {
+ if (content.length < 20000) { // striptags is slow for very large notes
+ content = striptags(content);
+ }
+
content = content.replace(/&nbsp;/g, ' ');
}