strip # or ~ when getting attribute

This commit is contained in:
zadam
2021-09-02 22:14:22 +02:00
parent 5f22864a93
commit 1bc50ed976
4 changed files with 21 additions and 17 deletions

View File

@@ -567,6 +567,10 @@ class Note extends AbstractEntity {
* @returns {Attribute[]} note's "owned" attributes - excluding inherited ones
*/
getOwnedAttributes(type, name) {
if (name && ["#", "~"].includes(name[0])) {
name = name.substr(1);
}
if (type && name) {
return this.ownedAttributes.filter(attr => attr.type === type && attr.name === name);
}