easy-markdown-editor
easy-markdown-editor copied to clipboard
EasyMDE applies Setext heading markdown format styling to YAML front matter
Describe the bug
EasyMDE applies markdown format styling (specifically Setext-style headings) to YAML front matter.
To reproduce
Put the following text into an EasyMDE editor instance:
---
title: Put article title here
author: Jane Doe
date: 8 December 2021
category: articles
---
Article content goes here. [...]
The category: articles\n---
lines will have heading styling applied due to the closing ---
. Screenshot provided below.
Expected behavior
EasyMDE will detect YAML front matter and not apply markdown styling to it. An alternative solution could be to apply markdown heading styling via Setext-style headings (---
) only if the line preceding the heading text is blank; i.e.:
Heading text
---
Screenshot
Version information
- OS: Windows 10
- Browser: Google Chrome 96
- EasyMDE version: v2.15.0 (current latest)
I made a pull request for this called extractYaml https://github.com/Ionaru/easy-markdown-editor/pull/494 since I needed it too. If you guys have any better option name please suggest.
In your use case, did you want to keep the yaml in preview?
Cause maybe yaml-frontmatter could just be default then extractYaml only removes it from preview.