Skip to content

✨ Wrap aliases containing a colon (:) in "double quotes" #790

@MasssiveJuice08

Description

@MasssiveJuice08

Describe the solution you'd like

Some notes generate an alias which contains a colon, e.g.,

---
aliases:
- Chapter 1: The Basics
---

However, this causes Obsidian to give an error "Type mismatch, expected Aliases". Is it possible for the CLI to wrap these in single or double quotes like below?

---
aliases:
- "Chapter 1: The Basics"
---

Describe alternatives you've considered

The following regex works to find aliases containing a colon, and wrap these in double quotes (tested in GrepWin with 'Dot matches newline' enabled):

  • regex find: (aliases:\r?\n)(- ([^:\r\n]+: [^\r\n]+))
  • regex replace: \1- "\3"

Manually fixing the aliases works too, but is tedious with large vaults.

Additional context

I believe this behaviour was introduced with f1c1159. See #682

Example in Obsidian of the type mismatch:
Image

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions