YAML title not properly parsed in preview frontmatter

Steps to reproduce

  1. Create a note with the following YAML front matter:
---
title: "Code: disable horizontal grid lines"
---
  1. Go to Markdown preview and note that "Code: " is incorrectly highlighted as a token key:

According to Obsidian, the "Code: part is not part of the title.

  1. To fix it, remove the colon (:) from the title and then the title is properly parsed:

Expected result

I would expect that Obsidian properly parses a double quoted title including colons (:).

Actual result

See images above.

Environment

  • Operating system: Windows 7 64-bit
  • Obsidian version: 0.9.19 64-bit.

Additional information

This is very low priority since it’s only a visual issue with the Markdown preview and export to PDF.

When I use the “Citation” plugin to parse the titles of a paper from the biblatex, this “yaml + colon” thing becomes annoying:

if there’s colon in the paper’s title, yaml cannot be recogonized by Obisidian, which impacts both alias and tags. It took me one whole hour to locate the bug is actually in the colon.

1 Like
title: Code: disable horizontal grid lines

is invalid YAML (and Obsidian will say so), whereas

title: "Code: disable horizontal grid lines"

is okay.

I quickly verified using Obsidian 0.11.13, using Dataview and Templater, and all is fine.

---
title: "Code: disable horizontal grid lines"
---

# Test YAML quoted

`= this.title`

<%+ tp.frontmatter.title %>

Result:

obsidian-YAML-quotes

Thanks for the input. For me the issue is still there on Obsidian 0.11.13. Meaning, the title is not parsed properly when there’s a colon in it.

Even though, like you say, a quoted string with colon is valid YAML.