Frontmatter inserted through template gets reduced whitespace count

Steps to reproduce

Create a template with some frontmatter, like:

---
foo:
    bar:
        baz: test
---

Create a new note and insert the template

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

Template to be inserted as is

Actual result

Frontmatter gets inserted, but with whitespaces in it being reduced to multiples of 2 rather than 4 as was the original and set in the Obsidian’s settings:

---
foo:
  bar:
    baz: test
---

Environment

SYSTEM INFO:
	Obsidian version: v1.6.7
	Installer version: v1.6.7
	Operating system: #1 SMP PREEMPT_DYNAMIC Wed, 04 Sep 2024 13:18:51 +0000 6.6.49-1-lts
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

There seem to be some weird pre-processing going on, as any comments inserted into frontmatter in template (intended to help fill it out when its inserted) also get erased

Properties reformats YAML headers, and comments are not supported.