mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
This commit is contained in:
parent
0a5bc9647d
commit
9338c5c810
@ -212,4 +212,15 @@ describe('models/Tag', () => {
|
||||
expect(commonTagIds.includes(tagc.id)).toBe(true);
|
||||
});
|
||||
|
||||
it('should allow finding tags even with special Unicode characters', async () => {
|
||||
const note1 = await Note.save({});
|
||||
// cSpell:disable
|
||||
await Tag.setNoteTagsByTitles(note1.id, ['Ökonomie']);
|
||||
|
||||
const tag1 = await Tag.loadByTitle('Ökonomie');
|
||||
const tag2 = await Tag.loadByTitle('ökonomie');
|
||||
// cSpell:enable
|
||||
|
||||
expect(tag1).toStrictEqual(tag2);
|
||||
});
|
||||
});
|
||||
|
@ -172,7 +172,9 @@ export default class Tag extends BaseItem {
|
||||
}
|
||||
|
||||
public static async loadByTitle(title: string): Promise<TagEntity> {
|
||||
return this.loadByField('title', title, { caseInsensitive: true });
|
||||
// Case insensitive doesn't work with especial Unicode characters like Ö
|
||||
const lowercaseTitle = title.toLowerCase();
|
||||
return this.loadByField('title', lowercaseTitle, { caseInsensitive: true });
|
||||
}
|
||||
|
||||
public static async addNoteTagByTitle(noteId: string, tagTitle: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user