From 56866951dce84d817367798ffdec1d4404eb7a91 Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Sun, 23 May 2021 17:02:20 +0200 Subject: [PATCH] Hotfix: fixed bug that was accidently reintroduced --- src/metaController.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/metaController.ts b/src/metaController.ts index 171289d..cd73cc3 100644 --- a/src/metaController.ts +++ b/src/metaController.ts @@ -302,9 +302,10 @@ export default class MetaController { const fileContent = await this.app.vault.read(file); const newFileContent = fileContent.split("\n").map(line => { - const regexp = new RegExp(`^\s*${property.key}`); + const propertyRegex = new RegExp(`^\s*${property.key}:`); + const tagRegex = new RegExp(`^\s*#${property.key}`); - if (line.match(regexp)) { + if (line.match(propertyRegex) || line.match(tagRegex)) { return this.updatePropertyLine(property, newValue); } @@ -350,8 +351,11 @@ export default class MetaController { for (const prop of properties) { const regexp = new RegExp(`^\s*${prop.key}`); + const tagRegex = new RegExp(`^\s*#${prop.key}`); + fileContent = fileContent.map(line => { - if (line.match(regexp)) { + + if (line.match(regexp) || line.match(tagRegex)) { return this.updatePropertyLine(prop, prop.content) }