Enable YAML header rendering for all .md files by default - #193
Closed
MarkShawn2020 wants to merge 1 commit into
Closed
MarkShawn2020 wants to merge 1 commit into
MarkShawn2020 wants to merge 1 commit into
Conversation
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>
|
👍 |
Owner
|
implemented on release 1.5.4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Flip the factory default of
yamlExtensionAllfromfalsetotrue, so plain.mdfiles get the same structured frontmatter rendering that.rmd/.qmdalready get.Motivation
With the current default, a typical Jekyll / Hugo / Zola / Obsidian file like:
…is fed to CommonMark as-is. The opening
---gets interpreted as a setext H2 underline, sotitle: My postbecomes 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:No logic changes — the existing
renderYamlHeaderpath atSettings+render.swift:105already handles this cleanly when the flag is on.Behavior
.mdfrontmatter renders as the existing table layout.UserDefaults.Test plan
.mdfile with YAML frontmatter → renders as a table.rmd/.qmdfiles unchanged