slidev: VSCode - format slides.md - break the build

Describe the bug If I format the markdown file - the build break.

before

---
layout: center-layout
---

after formatting

---

## layout: center-layout

To Reproduce Steps to reproduce the behavior:

  1. Run the dev
  2. Go to slides.md
  3. Make some slides with different layouts
  4. Format the Markdown file slides.md
  5. See the error

Desktop (please complete the following information):

  • OS: Mac
  • Browser: Chrome
  • Slidev version: 0.39

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 7
  • Comments: 16 (4 by maintainers)

Most upvoted comments

A cool suggestion would be to add a prettier parser 😄

I’m an idiot; I ran pnpm update and thought it updated, but since it was in a 0.x bump it didn’t automatically do it. Now on the latest version it works great!

(So, IMO this can be closed; sorry I didn’t notice that PR.)

I think it might be worth having a custom, prettier plugin/parser. As I don’t have much knowledge about Prettier (nor really using it), I might not have enough incentive to work on it very soon. Would appreciate if someone is interested in giving it a try

I’ve so far gotten through this with <!-- prettier-ignore-start --> or <!-- dprint-ignore-start -->, like:

<!-- prettier-ignore-start -->

---
layout: fact
---

<!-- prettier-ignore-end -->

But, another way to do this would be great.

I just add an the prettier config file in the root disabling it for .md