Preserve single-paired quoted values in YAML keys when using the new Property interface

Use case or problem

I tested a number of separate approaches for “protecting” formatting on property values (even ones that have been moved into the lineated array syntax) when editing properties through the interface, and found that the only protected syntaxes are '"ex"' and "'ample'" , which for the purposes of tags at the very least are quite cumbersome. The tags will assume a “true” form of #"ex" and #'ample' respectively (henceforth “double-paired” strings).

Additionally, modifying any property or adding a new property will fully reformat all entries excepting those that are “protected” in the manner described above—yet if this is deliberately avoided through only modifying the YAML through Source Mode, single-paired strings will still be appropriately recognized as tags.

Proposed solution

Personally I’d like to see at least one of two options:

  1. The forced formatting should be reduced or made more permissive, such that single-quoted values may be preserved since they are already recognized by the app and function correctly even in the Catalyst build of v.1.4.0.
  2. The YAML Frontmatter should be made to either explicitly disallow single-paired values with regards to native functionality, such that the following would no longer be recognized as valid tag syntax for any native features of the app.
    tags:
      - "#ex"
      - '#ample'
    

Current workaround

The only present solution is to avoid using the Property interface and only edit the YAML Frontmatter in Source Mode or through external text editors / programmatic methods.

Related feature requests

None at present, will be updated as brought to attention.

Thanks and Miscellanea

This issue was opened following and initial observation by @mediapathic , and his insights and suggestions regarding this feature request should be taken with greater priority than mine since it directly affects much of his work.

2 Likes

Steps to reproduce

Add YAML front matter to a file that includes the key “tags” and as value a list of tags formatted as '#tagname' (valid tag, valid YAML due to inclusion of single quotes), e.g.:

tags:
    - '#meeting'
    - '#work'

Now edit the tags inside Obsidian as part of the file Properties, e.g. by adding another tag.

Did you follow the troubleshooting guide? [Y/N]

Y

Expected result

The formatting of the existing tags is not changed.
Ideally: New tags use the same formatting. (A setting to handle this would also be great.)

Actual result

Tags are reformatted, the preceding hash sign is stripped.
The above example would look like this:

tags:
    - meeting
    - work

Environment

SYSTEM INFO:
Obsidian version: v1.4.2
Installer version: v1.2.8
Operating system: #1 SMP PREEMPT_DYNAMIC Mon, 24 Jul 2023 20:19:38 +0000 6.4.6-arch1-1
Login status: logged in
Catalyst license: supporter
Insider build toggle: on
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

The reason I see the behavior as a problem is that it breaks any workflow outside of Obsidian that relies on finding tags in the files by looking for words preceded directly by a hash sign. Parsing the front matter YAML is not an alternative as that is vastly more complicated and not even possible in some circumstances where only simple text search is available.

2 Likes

12 posts were merged into an existing topic: Properties: Do not strip hashtags in tags

A post was merged into an existing topic: Properties: Do not strip hashtags in tags

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.