obsidian.nvim
obsidian.nvim copied to clipboard
Invalid YAML frontmatter deletes the whole frontmatter
🐛 Describe the bug
Create a new note, and type some invalid frontmatter (below shown with markdown lists instead of YAML ones), e.g.:
---
id: Foo
aliases:
* bar
tags:
* foo
---
# Really Important Stuff
On save, the entire frontmatter is deleted and replaced with empty frontmatter.
This seems almost certainly like it should be filed somewhere, but apologies as I couldn't find it through a search.
Config
return {
{
'epwalsh/obsidian.nvim',
version = '*',
ft = 'markdown',
cmd = {
'ObsidianOpen',
'ObsidianNew',
'ObsidianQuickSwitch',
'ObsidianFollowLink',
'ObsidianBacklinks',
'ObsidianTags',
'ObsidianToday',
'ObsidianYesterday',
'ObsidianTomorrow',
'ObsidianDailies',
'ObsidianTemplate',
'ObsidianSearch',
'ObsidianLink',
'ObsidianLinkNew',
'ObsidianLinks',
'ObsidianExtractNote',
'ObsidianWorkspace',
'ObsidianPasteImg',
'ObsidianRename',
'ObsidianToggleCheckbox',
'ObsidianNewFromTemplate',
'ObsidianTOC',
},
dependencies = { 'nvim-lua/plenary.nvim' },
opts = {
workspaces = {
{
name = 'vault',
path = vim.env.XDG_DOCUMENTS_DIR .. '/Obsidian',
},
},
follow_url_func = vim.ui.open,
},
},
}
Environment
NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1725453128
Run "nvim -V1 -v" for more info
Obsidian.nvim v3.9.0 (ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b)
Status:
• buffer directory: nil
• working directory: /Users/julian/Documents/Obsidian
Workspaces:
✓ active workspace: Workspace(name='vault', path='/Users/julian/Documents/Obsidian', root='/Users/julian/Documents/Obsidian')
Dependencies:
✓ plenary.nvim: ec289423a1693aeae6cd0d503bac2856af74edaa
✓ nvim-cmp: ae644feb7b67bf1ce4260c231d1d4300b19c6f30
Integrations:
✓ picker: TelescopePicker()
✓ completion: enabled (nvim-cmp) ✗ refs, ✗ tags, ✗ new
all sources:
• nvim_lsp
• nvim_lsp_signature_help
• path
• lazydev
• buffer
Tools:
✓ rg: ripgrep 14.1.1
Environment:
• operating system: Darwin
Config:
• notes_subdir: nil% ```
For cross-reference because I just saw it, #509 is related in that the behavior I reported here is observed there (invalid YAML deletes what was added). But I personally still think this is undesirable general behavior in any case.