chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.48k stars 135 forks source link

Resolving Issue #545: "Create line if not found" at Top inserted AFTER frontmatter #595

Closed evanaze closed 6 months ago

evanaze commented 10 months ago

Description

This is a solution for issue #545 . As of Obsidian 1.4.0, the frontmatter position got moved from frontmatter.position to frontmatterPosition. See here: https://github.com/obsidianmd/obsidian-api/issues/122

As a result, the getFrontmatterEndPosition method in captureChoiceFormatter always returns -1, resulting in the note being added to the top of the file. This PR resolves that change in a backward compatible way by checking for both frontmatter.position and frontmatterPosition.

Testing

Unfortunately, I don't know how to test my changes. Any tips here would be appreciated.

vercel[bot] commented 10 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
quickadd ✅ Ready (Inspect) Visit Preview Feb 14, 2024 8:04pm
evanaze commented 7 months ago

@chhoumann please review.

chhoumann commented 6 months ago

fixes #595

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 1.7.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: