chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.53k stars 136 forks source link

Use commas (,) within multiple selector choices #239

Open ces3001 opened 2 years ago

ces3001 commented 2 years ago

Right now the comma acts as a choice separator: https://github.com/chhoumann/quickadd/blob/0b2efef4e3c19a448f4ed22e849b3ae0104dd944/src/formatters/formatter.ts#L90

Could this be made to ignore commas if they are inside quotes? For example: Choice1: This is a single choice, with a comma Choice2: Second choice would look like: {{VALUE:"This is a single choice, with a comma”,Second Choice}}

My use case is adding frontmatter to notes, which in my case, contains comma delineated fields in the following format {name: x, key: y} , and I want to choose amongst various options that contain multiple fields.

Thank you for writing great software!

ces3001 commented 2 years ago

Or use a different (potentially user-defined?) character, like the vertical bar “|” to separate choices. e.g. {{VALUE:This is a single choice, with a comma|Second Choice}}