Skip to content

verifyOrAddFrontMatter regex bug #84

@gentlegiantJGC

Description

@gentlegiantJGC

The verifyOrAddFrontMatter function in utils.ts has a bug where it will match keys that are not in the top level.
It thinks the data is there when it actually is not (because it is on a nested layer) and does not set the data as a result.

I don't know what the better solution would be here.
Perhaps using the cached version in the obsidian API to read.

I am facing a similar issue with writing the front matter for #82 where is need to overwrite that key.
In my original branch I added a function to read and write the front matter but this read the whole structure, parsed it and wrote it back. This meant that blank values got converted to null when saved which is not ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions