Skip to content

Enable YAML header rendering for all .md files by default - #193

Closed
MarkShawn2020 wants to merge 1 commit into
sbarex:mainfrom
MarkShawn2020:claude/heuristic-kilby-020cd0
Closed

MarkShawn2020 wants to merge 1 commit into
sbarex:mainfrom
MarkShawn2020:claude/heuristic-kilby-020cd0

Conversation

@MarkShawn2020

Copy link
Copy Markdown

Summary

Flip the factory default of yamlExtensionAll from false to true, so plain .md files get the same structured frontmatter rendering that .rmd / .qmd already get.

Motivation

With the current default, a typical Jekyll / Hugo / Zola / Obsidian file like:

---
title: My post
date: 2025-01-01
tags: [foo, bar]
---

Body...

…is fed to CommonMark as-is. The opening --- gets interpreted as a setext H2 underline, so title: My post becomes a heading, and the remaining keys collapse into a single paragraph. The result looks broken even though the YAML rendering code already exists and works — it's just gated to .rmd / .qmd.

Markdown frontmatter is now the dominant pattern across static-site generators and note-taking apps, so enabling it by default better matches user expectations.

Change

Single line in QLMarkdown/Settings.swift:

-    @objc var yamlExtensionAll: Bool = false
+    @objc var yamlExtensionAll: Bool = true

No logic changes — the existing renderYamlHeader path at Settings+render.swift:105 already handles this cleanly when the flag is on.

Behavior

  • New installs: .md frontmatter renders as the existing table layout.
  • Existing users: unaffected — their preference is already persisted in UserDefaults.
  • Opt-out: Preferences → YAML header popup → ".rmd, .qmd files" restores the old scope. Or switch it off entirely.

Test plan

  • Build & install locally, Quick Look a .md file with YAML frontmatter → renders as a table
  • Confirm the same file with the preference switched back to ".rmd, .qmd files" renders as before (falls through to CommonMark)
  • .rmd / .qmd files unchanged

Previously YAML frontmatter was rendered as a structured table only for
.rmd/.qmd files; plain .md files fell through to CommonMark, which turns
the opening `---` into a setext H2 underline and mashes the keys into a
paragraph. Since .md frontmatter is now ubiquitous (Jekyll, Hugo, Zola,
Obsidian, most static site generators), this default no longer matches
user expectations.

Flip the `yamlExtensionAll` factory default from false to true. Users
who prefer the previous scope can still restrict it via Preferences
(YAML header popup -> ".rmd, .qmd files").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hiphapis

Copy link
Copy Markdown

👍

@sbarex

sbarex commented Sep 17, 2026

Copy link
Copy Markdown
Owner

implemented on release 1.5.4

@sbarex sbarex closed this Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants