Skip to content

Build your personal knowledge base with Trilium Notes

allow searching within mermaid diagrams, closes #2821

zadam70edd9a21009
diff --git a/src/services/search/expressions/note_content_protected_fulltext.js b/src/services/search/expressions/note_content_protected_fulltext.js
index b24d3801a4..c93017a9a5 100644
--- a/src/services/search/expressions/note_content_protected_fulltext.js
+++ b/src/services/search/expressions/note_content_protected_fulltext.js
@@ -33,7 +33,7 @@ class NoteContentProtectedFulltextExp extends Expression {
for (let {noteId, type, mime, content} of sql.iterateRows(`
SELECT noteId, type, mime, content
FROM notes JOIN note_contents USING (noteId)
- WHERE type IN ('text', 'code') AND isDeleted = 0 AND isProtected = 1`)) {
+ WHERE type IN ('text', 'code', 'mermaid') AND isDeleted = 0 AND isProtected = 1`)) {
if (!inputNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) {
continue;
diff --git a/src/services/search/expressions/note_content_unprotected_fulltext.js b/src/services/search/expressions/note_content_unprotected_fulltext.js
index 60df925702..7b97722b8c 100644
--- a/src/services/search/expressions/note_content_unprotected_fulltext.js
+++ b/src/services/search/expressions/note_content_unprotected_fulltext.js
@@ -27,7 +27,7 @@ class NoteContentUnprotectedFulltextExp extends Expression {
for (let {noteId, type, mime, content} of sql.iterateRows(`
SELECT noteId, type, mime, content
FROM notes JOIN note_contents USING (noteId)
- WHERE type IN ('text', 'code') AND isDeleted = 0 AND isProtected = 0`)) {
+ WHERE type IN ('text', 'code', 'mermaid') AND isDeleted = 0 AND isProtected = 0`)) {
if (!inputNoteSet.hasNoteId(noteId) || !(noteId in becca.notes)) {
continue;