Skip to content

Commit

Permalink
Hotfix: fixed bug that was accidently reintroduced
Browse files Browse the repository at this point in the history
  • Loading branch information
chhoumann committed May 23, 2021
1 parent c36de61 commit 5686695
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/metaController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 5686695

Please sign in to comment.