Skip to content

Some empty lines is being removed in markdown YAML frontmatter #16342

@Mister-Hope

Description

@Mister-Hope

Prettier 3.3.0
Playground link

--parser markdown

Input:

---
title: Real Projects
icon: splotch
order: 1
category:
  - Demo

docs:
  - name: Waline
    desc: A Simple, Safe Comment System.
    logo: https://waline.js.org/logo.png
    url: https://waline.js.org/en/
    repo: https://github.com/walinejs/waline
    preview: /assets/image/waline.jpg

  - name: zkSync Era
    desc: A trustless protocol that uses cryptographic validity proofs to provide scalable and low-cost transactions on Ethereum
    logo: https://docs.zksync.io/zksync_logo_black.svg
    url: https://docs.zksync.io/
    repo: https://github.com/matter-labs/zksync-web-era-docs
    preview: /assets/image/zksync.jpg

portfolios:
  - name: Cheng Shang
    url: https://cheng-shang.me
    preview: https://cheng-shang.me/portfolio.avif
    repo: https://github.com/Mister-Hope/cheng-shang-portfolio

  - name: Cheng Shang
    url: https://cheng-shang.me
    preview: https://cheng-shang.me/portfolio.avif
    repo: https://github.com/Mister-Hope/cheng-shang-portfolio

blogs:
  - name: Mr.Hope's Blog
    desc: Where there is light, there is hope
    logo: https://mister-hope.com/logo.svg
    url: https://mister-hope.com
    repo: https://github.com/Mister-Hope/Mister-Hope.github.io
    preview: /assets/image/mrhope.jpg

  - name: Mo7's Blog
    desc: Something wonderful is about to happen.
    logo: https://file.mo7.cc/static/lxh_gif/lxh_71.gif
    url: https://blog.mo7.cc/en/
    repo: https://github.com/mo7cc/BlogSource.git
    preview: https://file.mo7.cc/disk/blog_preview_en.png

  - name: Guo's Page
    desc: Project documentation and study notes
    logo: https://guoxicheng.top/logo.png
    url: https://guoxicheng.top/en
    repo: https://github.com/GuoXiCheng/guoxicheng.github.io
    preview: /assets/image/guo-s-page-en.png
---

Output:

---
title: Real Projects
icon: splotch
order: 1
category:
  - Demo

docs:
  - name: Waline
    desc: A Simple, Safe Comment System.
    logo: https://waline.js.org/logo.png
    url: https://waline.js.org/en/
    repo: https://github.com/walinejs/waline
    preview: /assets/image/waline.jpg

  - name: zkSync Era
    desc: A trustless protocol that uses cryptographic validity proofs to provide scalable and low-cost transactions on Ethereum
    logo: https://docs.zksync.io/zksync_logo_black.svg
    url: https://docs.zksync.io/
    repo: https://github.com/matter-labs/zksync-web-era-docs
    preview: /assets/image/zksync.jpg

portfolios:
  - name: Cheng Shang
    url: https://cheng-shang.me
    preview: https://cheng-shang.me/portfolio.avif
    repo: https://github.com/Mister-Hope/cheng-shang-portfolio

  - name: Cheng Shang
    url: https://cheng-shang.me
    preview: https://cheng-shang.me/portfolio.avif
    repo: https://github.com/Mister-Hope/cheng-shang-portfolio

blogs:
  - name: Mr.Hope's Blog
    desc: Where there is light, there is hope
    logo: https://mister-hope.com/logo.svg
    url: https://mister-hope.com
    repo: https://github.com/Mister-Hope/Mister-Hope.github.io
    preview: /assets/image/mrhope.jpg
  - name: Mo7's Blog
    desc: Something wonderful is about to happen.
    logo: https://file.mo7.cc/static/lxh_gif/lxh_71.gif
    url: https://blog.mo7.cc/en/
    repo: https://github.com/mo7cc/BlogSource.git
    preview: https://file.mo7.cc/disk/blog_preview_en.png
  - name: Guo's Page
    desc: Project documentation and study notes
    logo: https://guoxicheng.top/logo.png
    url: https://guoxicheng.top/en
    repo: https://github.com/GuoXiCheng/guoxicheng.github.io
    preview: /assets/image/guo-s-page-en.png
---

Expected output:

Empty lines in blogs not being removed

Why?

......

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:markdownIssues affecting Markdownlang:mdxIssues affecting the MDX extension to Markdown (not general Markdown issues)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions