Skip to content

Frontmatter yaml is converted to *** #22

Closed as not planned
Closed as not planned
@coderaiser

Description

@coderaiser

Initial checklist

Affected package

latest

Steps to reproduce

Github issues templates uses yaml, and when I lint with remark the resulting markdown is being corrupted.

import remarkFrontmatter from 'remark-frontmatter'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import {unified} from 'unified'

const md = `
---
layout: "solar-system"
---

# Jupiter
`;

const file = await unified()
  .use(remarkParse)
  .use(remarkStringify)
  .use(remarkFrontmatter, ['yaml'])
  .use(function () {
    return function (tree) {
      console.dir(tree)
    }
  })
  .process(md)

console.log(String(file))

Actual behavior

***

## layout: "solar-system"

# Jupiter

Expected behavior

---
layout: "solar-system"
---

# Jupiter

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions