Skip to content

feat: add skipFootnoteLike option to inline span#29

Open
kermanx wants to merge 1 commit into
comarkdown:mainfrom
kermanx:main
Open

feat: add skipFootnoteLike option to inline span#29
kermanx wants to merge 1 commit into
comarkdown:mainfrom
kermanx:main

Conversation

@kermanx
Copy link
Copy Markdown
Contributor

@kermanx kermanx commented Apr 23, 2026

Adds a new option to mdc_inline_span that, when enabled, skips footnote-like syntax [^...] to avoid conflicts with footnote plugins (e.g. markdown-it-footnote).

By default, the option is true, which makes this PR a minor breaking change.

Usage:

md.use(MarkdownItMdc, { syntax: { inlineSpan: { skipFootnoteLike: true } } })

Changes:

  • Added skipFootnoteLike option to MdcInlineSpanOptions
  • Updated MarkdownItMdc to accept and pass options to inline span
  • Added fixture test case for default behavior ([^note] still treated as span)

Related issue:
This fixes the footnote compatibility issue reported in slidevjs/slidev#2524.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

npm i https://pkg.pr.new/@comark/markdown-it@29

commit: c06de7d

@kermanx kermanx force-pushed the main branch 2 times, most recently from 6d75e99 to a04be24 Compare April 23, 2026 05:11
@kermanx kermanx changed the title fix: skip footnote syntax [^...] in mdc_inline_span feat: add skipFootnoteLike option to inline span Apr 23, 2026
Adds a new option to mdc_inline_span that, when enabled, skips
footnote-like syntax [^...] to avoid conflicts with footnote plugins
(e.g. markdown-it-footnote).

By default, the option is false to preserve backward compatibility.

Usage:
  md.use(MarkdownItMdc, { syntax: { inlineSpan: { skipFootnoteLike: true } } })

Fixes compatibility with slidev and other tools using footnotes
alongside Comark/MDC syntax.
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

Successfully merging this pull request may close these issues.

1 participant