razziel89 / mdslw

Prepare your markdown for easy diff'ing!
GNU General Public License v3.0
14 stars 1 forks source link

Fix formatting breaking markdown frontmatter #11

Closed Skadic closed 7 months ago

Skadic commented 7 months ago

This should fix #10. Using this markdown file as an example:

---
item1: hello
item:
- my
- list
---

# Title

This is sentence one. This is sentence two.

Previously, the output from mdslw was:

---
item1:
hello item:
- my
- list
---

# Title

This is sentence one.
This is sentence two.

Note, that the frontmatter is broken now. My code changes strips the frontmatter from the markdown input before formatting, and adds it back at the end. Now, running mdslw results in:

---
item1: hello 
item:
- my
- list
---

# Title

This is sentence one.
This is sentence two.
razziel89 commented 7 months ago

Thanks again! The fix including some adjustments can be found in PR #13. Closing in favour of #13.