MacDownApp / MacDownApp/macdown
yaml frontmatter not handled correctly
- Dominant language
- Rich Text Format
- Stars
- 9.8k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
I've noticed that my markdown files with yaml frontmatter show up in the preview pane with the formatting all messed up.
- disregards carriage returns
- treats last line before frontmatter end markdown string "---" as a title
While working on this, suggest to also consider what is the desired behavior for frontmatter. In the example below, VS Code hides yaml-formatted frontmatter, and I believe that is the most common default behavior. Displaying frontmatter is also a valid choice IMO but ofc it should be an intentional design decision.
Example images below.
**VS Code (correct formatting applied):**
**MacDown (incorrect formatting):**
example images.
Contributor guide
Research direction
Start by reproducing the issue in the MacDown preview pane with a Markdown file containing YAML frontmatter, including carriage returns and a final line of "---". Trace the preview rendering or Markdown parsing entry point mentioned by the behavior, then define whether frontmatter is hidden or displayed and verify that line breaks and delimiters render correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, yaml
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100