Enhancement: forcePropertyValueQuotes #568

Closed
opened 2026-10-05 02:53:36 +02:00 by adam · 2 comments
Owner

Is your feature request related to a problem? Please describe.
When I edit a title with FM and it removes the quotes, I might accidentally add invalid characters to the title manually outside of FM. Removing/adding quotes as necessary is only good if you exclusively edit the content in FM, which isn't true for me.

Describe the solution you'd like
Just like how we have a frontMatter.taxonomy.noPropertyValueQuotes option to force remove quotes from some fields, it would be nice if we had a frontmatter.taxonomy.forcePropertyValueQuotes option that would let me say "always quote the title and description fields" (because I know it is too risky for FM to remove the quotes).

ASIDE: both of these options probably belong as options on the fields themselves, right? I suggested putting it in the same place as noPropertyValueQuotes but perhaps it should be on the field (setting.frontMatter.taxonomy.contentTypes.items.properties.fields.description)?

The other reason: I frankly prefer the consistency of my title and description fields always being quoted. Having it be as-needed makes it inconsistent and I don't love that.

Describe alternatives you've considered
I can't think of any alternatives that solve my issues. And these are definitely issues I can live with, so no alternatives are strictly required!

**Is your feature request related to a problem? Please describe.** When I edit a title with FM and it removes the quotes, I might accidentally add invalid characters to the title manually outside of FM. Removing/adding quotes as necessary is only good if you exclusively edit the content in FM, which isn't true for me. **Describe the solution you'd like** Just like how we have a [`frontMatter.taxonomy.noPropertyValueQuotes`](https://frontmatter.codes/docs/settings/overview#frontmatter.taxonomy.nopropertyvaluequotes) option to force remove quotes from some fields, it would be nice if we had a `frontmatter.taxonomy.forcePropertyValueQuotes` option that would let me say "always quote the title and description fields" (because I know it is too risky for FM to remove the quotes). ASIDE: both of these options probably belong as options on the fields themselves, right? I suggested putting it in the same place as `noPropertyValueQuotes` but perhaps it should be on the field (`setting.frontMatter.taxonomy.contentTypes.items.properties.fields.description`)? The other reason: I frankly prefer the consistency of my `title` and `description` fields always being quoted. Having it be as-needed makes it inconsistent and I don't love that. **Describe alternatives you've considered** I can't think of any alternatives that solve my issues. And these are definitely issues I can live with, so no alternatives are strictly required! <!-- github-sync-id:2001204344 -->
adam closed this issue 2026-10-05 02:53:36 +02:00
Author
Owner

Thanks @altano, makes sense to have this option. Just checked in the YAML parser we use and we can configure it for all string fields. The easiest option will be to add a new setting to always quote strings.

Thanks @altano, makes sense to have this option. Just checked in the YAML parser we use and we can configure it for all string fields. The easiest option will be to add a new setting to always quote strings. <!-- github-comment-id:1824518745 -->
Author
Owner

I've added the frontMatter.taxonomy.quoteStringValues setting, which is by default false as it will not change the current behaviour.

If you want to gain the consistency of always wrapping your string values with quotes, you can enable this with the setting as follows in the frontmatter.json file:

{
  "frontMatter.taxonomy.quoteStringValues": true
}

Testable in the latest beta version.

I've added the `frontMatter.taxonomy.quoteStringValues` setting, which is by default `false` as it will not change the current behaviour. If you want to gain the consistency of always wrapping your string values with quotes, you can enable this with the setting as follows in the `frontmatter.json` file: ```json { "frontMatter.taxonomy.quoteStringValues": true } ``` Testable in the latest beta version. <!-- github-comment-id:1824526496 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/vscode-front-matter#568