beaussan / update-time-on-edit-obsidian

MIT License
165 stars 15 forks source link

Error when frontmatter value contains colon #17

Closed qifei9 closed 1 year ago

qifei9 commented 2 years ago

When the original frontmatter is

---
key: "a:b"
---

After addition of timestamp by the plugin, it will become

---
key: "a:
created: 2021-11-30, 17:55
updated: 2021-11-30, 17:55
---
beaussan commented 2 years ago

Sorry for this bug, will work on a fix

DevJake commented 2 years ago

Can report I'm experiencing the same issue 😬

FeralFlora commented 2 years ago

Same here. I imported a literature note from Zotero using the Zotero Integration plugin, giving me the following YAML:

aliases: ["The Intergovernmental Panel on Climate Change: Guardian of Climate Science"]
title: "The Intergovernmental Panel on Climate Change: Guardian of Climate Science"

and after the plugin inserted date created and modified, it became:

aliases: ["The Intergovernmental Panel on Climate Change
title: "The Intergovernmental Panel on Climate Change

Thus rendering the YAML invalid. Probably gonna have to disable the plugin for now.

vertis commented 2 years ago

This is a fairly serious bug that is leaving me with quite a number of yaml frontmatter sections that are not just invalid, but have lost data. Is there any update on fixing this problem.

laurens-vrh commented 1 year ago

I had this problem as well and my pull request #46 seems to fix it for me. I don't know if the project maintainers are still active, but you should be able to fix it yourself by editing the main.js file in the plugin's folder. I did it with a simple find and replace of split(/: /, 2) with split(/: /). Hope this helps.

beaussan commented 1 year ago

Hi, sorry for the delay. This should now be fixed as of 2.0.0. If that's still an issue, feel free to re open a new issue !

guideblade commented 1 year ago

Still not fixed in 2.2.0