Open CharmedSatyr opened 2 months ago
Hey @CharmedSatyr . I believe this is a known issue. I don't think the Linter currently supports that syntax for YAML values, but I am open to changes to add that kind of support to the Linter.
Thanks @pjkaufman. There is a note in the option about blank lines being removed and nested keys not being sorted. However, for me, it is unexpected behavior that the linter would delete (potentially lots of) non-blank lines of properly formatted front matter. This ticket does feel like a bug rather than feature request for that reason.
Hey @CharmedSatyr , this is a bug, but it has come up before if I recall and the issue was using a syntax that the Linter currently does not properly handle. There have been discussions on how to fix this, but none of them have yielded any fruit for now. So this is something where I am looking for help from other devs to contribute a fix for this issue as this literal operator is not currently handled by the Linter.
For context, the prior report of this bug was https://github.com/platers/obsidian-linter/issues/992
Describe the Bug
When the YAML Key Sort option
Sorts the YAML keys based on the order and priority specified.
and aYAML Sort Order for Other Keys
order is enabled, nested content after a literal operator|
is removed.This is a problem for me because I'm using Obsidian Custom Sort, which recommends syntax with a
sorting-spec
key followed by a literal operator.How to Reproduce
Settings > Linter > Sorts the YAML keys based on the order and priority specified.
YAML Sort Order for Other Keys
toAscending Alphabetical
orDescending Alphabetical
.|
will be removed.Example
order-desc: a-z
will be removed.Expected Behavior
Nested content after a literal operator should not be removed.
Device