core: use only first 10 words of headline in title

This commit is contained in:
ammarahm-ed
2023-06-05 11:50:20 +05:00
committed by Abdullah Atta
parent e75c62e6e1
commit c5a264270c

View File

@@ -447,7 +447,10 @@ export default class Notes extends Collection {
) {
return oldNote.title.replace(NEWLINE_STRIP_REGEX, " ");
}
return this.formatTitle(this._db.settings.getTitleFormat(), headline);
return this.formatTitle(
this._db.settings.getTitleFormat(),
headline?.split(" ").splice(0, 10)
);
}
}