# \[Bug\] Using the properties menu deletes YAML comments from the frontmatter

**URL:** <https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048>\
**Category:** Help\
**Tags:** properties\
**Created:** [October 9, 2023, 9:16pm UTC](https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048 "2023-10-09T21:16:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Quanttek](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/q/e8c25b/32.png) [@Quanttek](https://forum.obsidian.md/u/Quanttek)\
**Post date:** [October 9, 2023, 9:16pm UTC](https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048/1 "2023-10-09T21:16:56Z")

</div>

### Steps to reproduce

1. In source mode, add a property and a YAML comment to the frontmatter, like such:

```auto
---
tags:
# comment
---

```

1. Exit source mode and go back into source mode. Nothing will have changed.
2. Exit source mode and change the property by adding a value, such as a tag.
3. Switch back into source mode

### Expected result

Like in previous Obsidian versions, the comment should still be in the frontmatter

### Actual result

The YAML comment has disappeared from the frontmatter

### Environment

```auto
SYSTEM INFO:
	Obsidian version: v1.4.14
	Installer version: v1.4.13
	Operating system: Darwin Kernel Version 22.6.0: Wed Jul 5 22:22:52 PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T8103 22.6.0
	Login status: not logged in
	Insider build toggle: off
	Live preview: on
	Legacy editor: off
	Base theme: dark
	Community theme: Minimal v7.2.1
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 34
	Plugins enabled: 25
		1: Dictionary v2.22.0
		2: Quick Switcher++ v3.3.7
		3: LanguageTool Integration v0.3.4
		4: Linter v1.20.0
		5: Style Settings v1.0.7
		6: Contextual Typography v2.2.5
		7: Reminder v1.1.15
		8: Omnisearch v1.17.1
		9: Zotero Integration v3.0.10
		10: Calendar v1.5.10
		11: Tolino notes Importer v1.0.3
		12: List Callouts v1.1.4
		13: Emoji Shortcodes v2.2.0
		14: Recent Files v1.3.8
		15: Copy Block Link v1.0.4
		16: Advanced Tables v0.19.1
		17: Outliner v4.8.0
		18: Natural Language Dates v0.6.1
		19: Pandoc Plugin v0.4.1
		20: Minimal Theme Settings v7.3.0
		21: Templater v1.16.3
		22: Tag Wrangler v0.6.1
		23: Dataview v0.5.61
		24: Tasks v4.9.0
		25: QuickAdd v1.4.0

```

* * *

### Additional information

This is a very recent bug. A few minor versions/weeks ago, I am very confident this wasn’t a problem yet.

The reason this bug is significant is that I need to add comments to the frontmatter to tell the Zotero integration plugin to “persist” my custom metadata. Thereby, it breaks the workflow of a number of academics like myself. More broadly, this bug may break the functionality of a number of plugins that rely on YAML comments to add additional information to the frontmatter.

I would be very grateful for a fix ☺

---

<div class="post-metadata">

**Author:** ![WhiteNoise](https://forum.obsidian.md/user_avatar/forum.obsidian.md/whitenoise/32/11_2.png) [@WhiteNoise](https://forum.obsidian.md/u/WhiteNoise)\
**Post date:** [October 9, 2023, 10:25pm UTC](https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048/2 "2023-10-09T22:25:56Z")

</div>

It’s not that recent.

> [@API: processFrontMatter removes string quotes, comments, types, formatting](https://forum.obsidian.md/t/api-processfrontmatter-removes-string-quotes-comments-types-formatting/65851/6):
>
> So we’ve had long debates about this, and it mostly comes down to a trade-off between allowing user to store arbitrary comments and formatting in the YAML, vs making it not painful for plugins to interact with YAML. I will say that it is rather unfortunate that YAML became the most popular way markdown documents store metadata. YAML is difficult to write by hand because it provides way too many options to write the same thing, and there’s a lot of “gotchas” such as reserved keywords, the many m…

Moved to help.

---

<div class="post-metadata">

**Author:** ![Quanttek](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/q/e8c25b/32.png) [@Quanttek](https://forum.obsidian.md/u/Quanttek)\
**Post date:** [October 10, 2023, 11:49am UTC](https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048/3 "2023-10-10T11:49:45Z")

</div>

ok thanks! Didn’t find the the thread below. Even if it’s not recent, I am confident it happened a bit after the introduction of Properties. While I understand the desire to expose a clean API, it would be great if comments are preserved because that would otherwise mean breakage for a number of template engines when they interact with the frontmatter.

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [January 8, 2024, 11:50am UTC](https://forum.obsidian.md/t/bug-using-the-properties-menu-deletes-yaml-comments-from-the-frontmatter/69048/4 "2024-01-08T11:50:17Z")

</div>

Closed on January 8, 2024, 11:50am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
