Alias wrapped in quotation marks results in two separate aliases when there is a comma.
Steps to reproduce
I have this in my frontmatter: aliases: "Race for your Life, Charlie Brown"
Expected result: Race for your Life, Charlie Brown as the alias.
Actual Result: Race for your Life Charlie Brown
so 2 aliases.
It works as expected when the current alias, with the quotation marks, is wrapped in square brackets in the frontmatter: aliases: ["Race for your Life, Charlie Brown"]
gives this alias: Race for your Life, Charlie Brown
Question:
Shouldn’t the quotation marks be enough to create the one alias?
Aren’t the square brackets for multiple aliases rather than a single?
As far as YAML goes, the above returns a str (correct, to my knowledge), but it seems Obsidian somehow splits the str by commas.
It probably makes it easier for an average user (YAML can be confusing and has some odd rules!) and maybe they thought about tags when programming this, but I still think it’s probably wrong, from a YAML standpoint.
In a YAML str type scalar, the comma has no special meaning, whereas in a (flow) sequence or map it has.
Example:
aliases: this, that
this, that is onestr.
aliases: [this, that]
[this, that] is a flow sequence of two comma-separated strs: this and that.
aliases:
- this
- that
is also a sequence of twostrs: this and that.
Interestingly, in the latter case, Obsidian does it correct: It returns the this and that strings even if they contain commas:
aliases:
- this
- that, but it has a comma
will return (correctly) twostrs: this and that, but it has a comma!
So yes, I’d consider the current behaviour a bug.