Skip to content

Support formatting frontmatter #125

@awmottaz

Description

@awmottaz

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
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions