Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: processFrontMatter does not work if callback deletes all keys #164

Open
AndyEveritt opened this issue Apr 21, 2024 · 0 comments
Open

Comments

@AndyEveritt
Copy link

https://docs.obsidian.md/Reference/TypeScript+API/FileManager/processFrontMatter

Note

I am not a JS/TS developer so my terminology is likely wrong

Steps to reproduce:

await this.app.fileManager.processFrontMatter(
  sharedFile.file,
  (frontmatter) => {
    // Remove the shared link
    delete frontmatter["link"];
  }

taken from project

if link is the only field in the frontmatter object then this will not do anything. If there are other fields then the link field is correctly deleted

Expected Behaviour

The provided code would delete the link field from the frontmatter regardless of is it leaves the frontmatter empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant