[\s\S]*<\/div>$/)) {
- // Keep consistent with getNote()
- noteText = '
' + noteText + '
';
+ noteText = Zotero.Notes.notePrefix + noteText + Zotero.Notes.noteSuffix;
}
let params = [
diff --git a/chrome/content/zotero/xpcom/data/searchConditions.js b/chrome/content/zotero/xpcom/data/searchConditions.js
index 6c4905f380..5fe884a9d5 100644
--- a/chrome/content/zotero/xpcom/data/searchConditions.js
+++ b/chrome/content/zotero/xpcom/data/searchConditions.js
@@ -338,7 +338,9 @@ Zotero.SearchConditions = new function(){
doesNotContain: true
},
table: 'itemNotes',
- field: 'note'
+ // Exclude note prefix and suffix
+ field: `SUBSTR(note, ${1 + Zotero.Notes.notePrefix.length}, `
+ + `LENGTH(note) - ${Zotero.Notes.notePrefix.length + Zotero.Notes.noteSuffix.length})`
},
{
@@ -348,7 +350,9 @@ Zotero.SearchConditions = new function(){
doesNotContain: true
},
table: 'items',
- field: 'note'
+ // Exclude note prefix and suffix
+ field: `SUBSTR(note, ${1 + Zotero.Notes.notePrefix.length}, `
+ + `LENGTH(note) - ${Zotero.Notes.notePrefix.length + Zotero.Notes.noteSuffix.length})`
},
{