YAML incorrectly parses an in-line assignation of a comma-containing alias enclosed in speech marks

Steps to reproduce

Enclose an alias containing a comma within speech marks and assign it to a file using YAML in-line syntax, such as:

---
alias: 'One, two and three'
---

Expected result

I expected one alias to be assigned to the note, namely

  • One, two and three

(I know the comma is used as a separator for in-line assignations, but the enclosing speech marks normally take precedence)

Actual result

Two aliases are assigned to the note, namely:

  • One
  • two and three

It is as though the speech marks were not present, they are ignored (not even featuring in the aliases, which would at least be somewhat consistent)

Workaround

List assignation works fine. That is,

---
alias:
- One, two and three
---

gives the expected result.

Environment

  • Operating system: macOS 11.5.1
  • Obsidian version: 0.12.12
  • Obsidian installer version: 0.12.3

Seems like with tags: Intentionally breaking YAML syntax for the “benefit” of the user (by splitting YAML str’s by ,).

Personally, I’d prefer Obsidian sticking with YAML syntax, i.e.

  • aliases: 'One, two and three'one alias
  • aliases: "One, two and three"one alias
  • aliases: One, two and threeone alias
  • aliases: ['One', 'two and three']two aliases
  • aliases: ["One", "two and three"]two aliases
  • aliases: [One, two and three]two aliases
  • aliases:
      - One, two and three
    
    one alias
  • aliases:
      - One
      - two and three
    
    two aliases
  • and so on …

It’s a good summary, I suggest you copy it to the FR I linked.

Yep, will do.

Thanks. I searched before starting this topic, but I did not see the earlier post. Had I seen it, it might have saved us (especially me) some time. I suppose it was not clear from the title, nor the category…

@Nifty it’s okay, this is kind of though issue to figure out if don’t know the spec and you don’t figure out that we violated it. I tried to rename the FR to be clearer.

1 Like