markdown-exit icon indicating copy to clipboard operation
markdown-exit copied to clipboard

linkify-it is bundled even with `linkify: false`

Open onmax opened this issue 1 month ago • 0 comments

MarkdownExit always runs new LinkifyIt() in its constructor, so linkify-it ends up in every bundle, even when linkify is off. that's 9.0 KiB minified / 2.8 KiB gzip that apps without autolinks can't tree-shake. markdown-it works the same way, so this would be a markdown-exit improvement rather than a backport.

some options:

  • accept a linkify instance through options (new MarkdownExit({ linkify: new LinkifyIt() })) and drop the default import. this is breaking.
  • add a markdown-exit/core entry without the linkify rule and its import, and keep the default entry as it is.
  • move linkify to a plugin (md.use(linkify)). also breaking, and the furthest from markdown-it.

would any of these fit the project?

onmax avatar Nov 02 '26 12:11 onmax