editor: fix frontmatter heading styling#426
Conversation
|
Thanks @junereycasuga — this is exactly right, and yes, it's the intended UI: leading frontmatter is meant to render as a compact metadata card, never as body-heading typography. Nice diagnosis on the setext-heading tokenization (a frontmatter line abutting the closing Merged into the v2.15.0 release branch in 9ab0424 (this repo lands fixes on a per-release branch that fast-forwards into |
|
Small correction: I couldn't retarget the base — GitHub reports "no new commits between v2.15.0 and fix/frontmatter-render" because your commit is already contained in the release branch (I brought it in via a merge, 9ab0424, so your authorship is preserved). I'll leave this PR open against |
Fix frontmatter styling in the editor.
CodeMirror can tokenize the line before a closing
---frontmatter fence as a setext heading when there isn't a blank line before the fence. This caused valid frontmatter to render with large heading typography in edit mode.This makes frontmatter card styling override heading tokens inside the frontmatter block, so both forms render consistently.
Also adds a preview regression test that verifies leading YAML/TOML frontmatter is hidden from rendered markdown.
Before:

After:
