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

markdown-it plugins running twice? #1592

Closed
gureckis opened this issue May 14, 2024 · 2 comments
Closed

markdown-it plugins running twice? #1592

gureckis opened this issue May 14, 2024 · 2 comments

Comments

@gureckis
Copy link

Describe the bug
It seems that markdown-it plugins are being run more than once to the same slide. For instance, I tried using the markdown-it-footnote plugin. It works ok but inserts the footnote material twice at the bottom of the slide. I reported a similar behavior in #1579 which i attributed to the editor but might also be the same issue?

To Reproduce
Steps to reproduce the behavior:

  1. install markdown-it-footnote
  2. add it to your vite-config.mjs:
import { defineConfig } from 'vite'
import footnote from 'markdown-it-footnote'

export default defineConfig({
  slidev: {
    vue: {
      /* vue options */
    },
    markdown: {
      /* markdown-it options */
      markdownItSetup(md) {
        /* custom markdown-it plugins */
        md.use(footnote)
      },
    },
    /* options for other plugins */
  },
})
  1. made a slide with a footnote
---
layout: default
---

# Hello

- Here is a bullet^[here is a foonote]
  1. Results
Screenshot 2024-05-14 at 12 25 30 PM

Desktop (please complete the following information):

  • OS:
  • Browser:
  • Slidev version: v0.49.0-beta.6
  • Markdown-it-footnote version: 4.0.0
@antfu antfu added bug Something isn't working and removed bug Something isn't working labels May 14, 2024
@antfu
Copy link
Member

antfu commented May 14, 2024

Wait... probably because we have markdown-it-footnote already builtin?

@gureckis
Copy link
Author

doh 😳!! yes confirmed, that was the issue.

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

2 participants