Issue: the presence of a colon in a string field causes crashes #623

Closed
opened 2026-10-05 02:56:52 +02:00 by adam · 1 comment
Owner

Describe the bug
The presence of a colon in a non-quoted string field causes issues.

  1. The syntax highlighting mistakenly captures text beyond the first colon as part of the key.
  2. The FM activity tab sometimes appears as if no frontmatter schema or content is defined, and sometimes it just outright crashes.

To Reproduce
An example of frontmatter which breaks the Frontmatter CMS plugin for vscode:

---
title: Introducing: Star Wars 13
caption: You thought they couldn't ruin Star Wars any further. You were wrong.
---

In this case the syntax highlighting shows "title: Introducing:" as the key instead of identifying "Introducing: " as part of the value

Expected behavior
Handle it without crashing. It can be worked around by putting double-quotes around the title (which is done automatically if you enter the colon in the FM activity tab instead of directly in the code editor).

Desktop (please complete the following information):

I've reproduced it on the following:

  • Arch Linux, vscode 1.88.0, FrontMatter CMS 10.0.2
  • Arch Linux, vscodium 1.88.0, FrontMatter CMS 10.0.2
  • Windows 10, vscode 1.88, FrontMatter CMS 10.0.2
**Describe the bug** The presence of a colon in a non-quoted string field causes issues. 1. The syntax highlighting mistakenly captures text beyond the first colon as part of the key. 2. The FM activity tab sometimes appears as if no frontmatter schema or content is defined, and sometimes it just outright crashes. **To Reproduce** An example of frontmatter which breaks the Frontmatter CMS plugin for vscode: ``` --- title: Introducing: Star Wars 13 caption: You thought they couldn't ruin Star Wars any further. You were wrong. --- ``` In this case the syntax highlighting shows "title: Introducing:" as the key instead of identifying "Introducing: " as part of the value **Expected behavior** Handle it without crashing. It can be worked around by putting double-quotes around the title (which is done automatically if you enter the colon in the FM activity tab instead of directly in the code editor). **Desktop (please complete the following information):** I've reproduced it on the following: - Arch Linux, vscode 1.88.0, FrontMatter CMS 10.0.2 - Arch Linux, vscodium 1.88.0, FrontMatter CMS 10.0.2 - Windows 10, vscode 1.88, FrontMatter CMS 10.0.2 <!-- github-sync-id:2229245356 -->
adam closed this issue 2026-10-05 02:56:52 +02:00
Author
Owner

Thanks, @nathanchere, for opening the issue. The YAML parser fails to parse the front matter section, and you should see the following error message:

image

Wrapping the title with quotes is the solution, but the CMS does not automatically do it as it would first need a valid YAML object to parse it.

Thanks, @nathanchere, for opening the issue. The YAML parser fails to parse the front matter section, and you should see the following error message: ![image](https://github.com/estruyf/vscode-front-matter/assets/2900833/6d149da7-fcb2-4c51-82da-0b1aee45a3f7) Wrapping the title with quotes is the solution, but the CMS does not automatically do it as it would first need a valid YAML object to parse it. <!-- github-comment-id:2042488572 -->
adam changed title from Issue: the presence of a colon in a string field causes crashes to Issue: the presence of a colon in a string field causes crashes 2026-10-27 13:22:40 +01:00
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#623