Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support formatting frontmatter #125

Open
awmottaz opened this issue Sep 24, 2024 · 0 comments
Open

Support formatting frontmatter #125

awmottaz opened this issue Sep 24, 2024 · 0 comments

Comments

@awmottaz
Copy link

From what I've seen, the gray-matter library is the de facto standard for parsing frontmatter in markdown files. It parses YAML by default, and YAML is by far the most common syntax I see for frontmatter.

It would be great if dprint-plugin-markdown would format the frontmatter block following the syntax from gray-matter.

I have installed dprint-plugin-markdown and g-plane/pretty_yaml. Given the following input:

---
- some yaml frontmatter
        - this is nested too deep
---

```yaml
- a yaml code block
        - this is nested too deep
```

The output I get after formatting is:

---
- some yaml frontmatter
        - this is nested too deep
---

```yaml
- a yaml code block
  - this is nested too deep
```

This is what I want to happen:

---
- some yaml frontmatter
  - this is nested too deep
---

```yaml
- a yaml code block
  - this is nested too deep
```
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

No branches or pull requests

1 participant