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

Fix: Live Preview Update Breaks Frontmatter if Frontmatter Exists and Update Happens on the --- of the end of the Frontmatter #1094

Merged
merged 3 commits into from
Jun 1, 2024

Conversation

pjkaufman
Copy link
Collaborator

Fixes #1093

There was an issue in Live Preview mode where sometimes updating the value of the frontmatter would cause the frontmatter to become broken. What was happening was that when the frontmatter existed, if you updated the very end of the frontmatter, it was not accounting for the ending --- of the frontmatter in what to ignore on the updates. Thus it would attempt a partial update which would mess up the document.

Changes Made:

  • Add an offset to ignore the ending --- of the frontmatter
  • Added an integration test for this scenario

@pjkaufman pjkaufman added bug Something isn't working obsidian Obsidian specific syntax issue or feature live-preview labels Jun 1, 2024
@pjkaufman pjkaufman self-assigned this Jun 1, 2024
@pjkaufman pjkaufman merged commit 5ca7b43 into platers:master Jun 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working live-preview obsidian Obsidian specific syntax issue or feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Linter deletes line beginnings and modifies front matter content in certain documents in edit mode
1 participant