# Source mode: front matter highlighting breaks on a ' inside a plain value and at an escaped \\"

**URL:** <https://forum.obsidian.md/t/source-mode-front-matter-highlighting-breaks-on-a-inside-a-plain-value-and-at-an-escaped/120029>\
**Category:** Bug reports\
**Created:** [October 31, 2026, 2:12am UTC](https://forum.obsidian.md/t/source-mode-front-matter-highlighting-breaks-on-a-inside-a-plain-value-and-at-an-escaped/120029 "2026-10-31T02:12:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnaoumov](https://forum.obsidian.md/user_avatar/forum.obsidian.md/mnaoumov/32/22325_2.png) [@mnaoumov](https://forum.obsidian.md/u/mnaoumov)\
**Post date:** [October 31, 2026, 2:12am UTC](https://forum.obsidian.md/t/source-mode-front-matter-highlighting-breaks-on-a-inside-a-plain-value-and-at-an-escaped/120029/1 "2026-10-31T02:12:19Z")

</div>

This is a follow-up to [YAML Fontmatter syntax highlighter has issues with quotes](https://forum.obsidian.md/t/38294), which was moved to the graveyard with the reply “This doesn’t happen anymore” and then closed automatically. It still happens in Source mode. In Live Preview the Properties widget hides the front matter text, so the highlighting cannot be seen there, which may be why it looked fixed.

### Steps to reproduce

1. Create a note with this text:

2. Switch the note to Source mode.

### Did you read and follow the [Troubleshooting Guide](https://forum.obsidian.md/t/about-the-bug-reports-category/24/11) ? [Yes/No]

Yes. It reproduces in a fresh vault with no plugins, theme or snippets.

### Expected result

Both values are styled the way YAML reads them:

- `problem1` is a plain scalar. The `'` in the middle of it does not start a string, so nothing on that line is styled as a string.
- `problem2` is one double-quoted string. `\"` is an escaped quote, so the string runs to the last `"` on the line.

### Actual result

- `problem1`: `Single quote ` is plain, then everything from the `'` to the end of the line, `' and YAML syntax highlighter`, is styled as a string (`cm-string`).
- `problem2`: the string ends at the escaped quote. `"Escaping quotes \"` is styled as a string, ` and YAML syntax highligher` is plain, and the final `"` is styled as the start of a new string.
- `after: plain` on the next line is unaffected.

Reading view gets this right. The front matter it renders for the same note is highlighted with `problem1` plain and the whole of `problem2` as one string.

Workaround for links in front matter: my plugin [Frontmatter Markdown Links](https://forum.obsidian.md/t/92883) reads quoted values the way YAML does, both escapes included, so the links it shows in Source mode are not thrown off by this. The highlighting itself is still wrong.

### Environment

```auto
SYSTEM INFO:
	Obsidian version: 1.14.5
	Installer version: 1.14.5
	Operating system: Windows 11 Pro 10.0.26300
	Login status: not logged in
	Language: en
	Insider build toggle: off
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 0
	Plugins enabled: 0

RECOMMENDATIONS:
	none

```
