YAML section weirdness w/ whitespace and dashes? -- after v1.4.5

Since Obsidian v1.4.5 dropped I’m noticing some very odd behavior in the frontmatter section when I apply Templater templates. Note, these templates make use of the Dataview and MetaEdit APIs, and sometimes the templates are applied in close succession using QuickAdd macros. I get that my use cases may be fringe, but I thought I would put this out there to see if others are experiencing similar issues.

Primary symptom I am seeing is extra whitespace that is added to the bottom of the YAML section after applying a template that uses MetaEdit:

---
banner: "![[Banner.png]]"
sampleStringOG: TSPFOWTRWPD
samplerStringOG: PFTSCDPCDCW
sampleString: WPD
samplerString: DCW
sampleIndex: 8
samplerIndex: 8

---

The above is weird, but it has no impact unless it’s combined with one of the other symptoms I’ve noticed:

1-3 dashes are added to the closing dashes of the YAML section, causing a bullet point or a horizontal rule to render at the top of my page:

---
banner: "![[Banner.png]]"
sampleStringOG: TSPFOWTRWPD
samplerStringOG: PFTSCDPCDCW
sampleString: WPD
samplerString: DCW
sampleIndex: 8
samplerIndex: 8

------

Whitespace after the YAML section is removed, which for me breaks the next section of my page that happens to be a Dataviewjs block:

---
banner: "![[Banner.png]]"
sampleStringOG: TSPFOWTRWPD
samplerStringOG: PFTSCDPCDCW
sampleString: WPD
samplerString: DCW
sampleIndex: 8
samplerIndex: 8

---```dataviewjs

Closing 3 dashes are added after the first YAML property, which causes the remaining YAML properties to render like normal text:

---
banner: "![[Banner.png]]"
---
sampleStringOG: TSPFOWTRWPD
samplerStringOG: PFTSCDPCDCW
sampleString: WPD
samplerString: DCW
sampleIndex: 8
samplerIndex: 8

---

I will usually get one of these 3 symptoms if I do not fix the first symptom (whitespace at the bottom of the YAML section) before I go on to apply another template to the page.

Like I said, because of my heavy plugin use I know it’s probably a long shot that anyone else is seeing these symptoms. Just thought I’d put this out there in case anyone has useful information for me.

Not gonna help you much here, I’m afraid.

  • I had some whitespace issues before 1.4.5 in Templater. It was my fault because my template md files were also linted and some soft line breaks were added. Deleting those fixed my problem.
  • You could write to the QuickAdd dev at GitHub about it. Maybe he can offer some fixes.
  • The Templater dev is otherwise engaged but the active helper, a guy named Zach is very helpful with anything thrown at him; see here.

My not-too-fringe templates work well otherwise since the introduction of Properties.

1 Like