Merge branch 'stable'

This commit is contained in:
zadam
2023-03-26 23:11:47 +02:00
10 changed files with 50 additions and 14 deletions

View File

@@ -1 +1 @@
module.exports = { buildDate:"2023-02-28T23:39:34+01:00", buildRevision: "9eb3075f65af98bd8c4a8ca8cc241ae2ae05bfa9" };
module.exports = { buildDate:"2023-03-14T21:15:08+01:00", buildRevision: "d8e9086bdeb721db795783b5d92395a9bd6882c9" };

View File

@@ -156,7 +156,7 @@ class ConsistencyChecks {
let message = `Branch '${branchId}' was was missing parent note '${parentNoteId}', so it was deleted. `;
if (becca.getNote(noteId).getParentBranches().length === 0) {
const newBranch = new Branch({
const newBranch = new BBranch({
parentNoteId: 'root',
noteId: noteId,
prefix: 'recovered'
@@ -447,7 +447,7 @@ class ConsistencyChecks {
branch.markAsDeleted("parent-is-search");
// create a replacement branch in root parent
new Branch({
new BBranch({
parentNoteId: 'root',
noteId: branch.noteId,
prefix: 'recovered'

View File

@@ -299,7 +299,9 @@ function highlightSearchResults(searchResults, highlightedTokens) {
// which would make the resulting HTML string invalid.
// { and } are used for marking <b> and </b> tag (to avoid matches on single 'b' character)
// < and > are used for marking <small> and </small>
highlightedTokens = highlightedTokens.map(token => token.replace('/[<\{\}]/g', ''));
highlightedTokens = highlightedTokens
.map(token => token.replace('/[<\{\}]/g', ''))
.filter(token => !!token?.trim());
// sort by the longest, so we first highlight the longest matches
highlightedTokens.sort((a, b) => a.length > b.length ? -1 : 1);
@@ -307,7 +309,7 @@ function highlightSearchResults(searchResults, highlightedTokens) {
for (const result of searchResults) {
const note = becca.notes[result.noteId];
result.highlightedNotePathTitle = result.notePathTitle.replace('/[<\{\}]/g', '');
result.highlightedNotePathTitle = result.notePathTitle.replace(/[<{}]/g, '');
if (highlightedTokens.find(token => note.type.includes(token))) {
result.highlightedNotePathTitle += ` "type: ${note.type}'`;