PLUGIN_COMPATIBILITY_CHECK.md
December 1, 2025 · View on GitHub
Plugin Compatibility Check — Notes & How-to
This document lists markdown-it related plugins found in the repository metadata and provides a reproducible check to validate import/interop behavior in your environment.
Found plugin packages (from package.json devDependencies / dependencies):
markdown-it(dev)markdown-exit(dev)markdown-it-abbrmarkdown-it-containermarkdown-it-deflistmarkdown-it-emojimarkdown-it-footnotemarkdown-it-for-inlinemarkdown-it-insmarkdown-it-markmarkdown-it-submarkdown-it-supmarkdown-it-testgen
Guidance
- Most of the above are small plugins that implement the conventional plugin signature
function (md, opts)and are expected to work. However, verify the following for each plugin you use in your project:- Module entry format (ESM vs CJS). If your app is CommonJS, test dynamic
import()orcreateRequireinterop. - Whether the plugin imports internal
markdown-itinternals (e.g.markdown-it/lib/...) — such imports are brittle and will break if internals are restructured.
- Module entry format (ESM vs CJS). If your app is CommonJS, test dynamic
Reproducible check (script)
- Run
node ./scripts/check-plugin-interop.mjs plugin-name ...to test how each plugin behaves when imported from an ESM environment and as a require() fallback. The script will print whether the imported value is a function and whether it has.default.
Example
node ./scripts/check-plugin-interop.mjs markdown-it-emoji markdown-it-footnote
Interpretation
- If the script reports
imported: function→ plugin likely works when used asimport plugin from 'pkg'. - If the script reports
imported: object, has default function→ when usingimport pkg from 'pkg', you may needpkg.default(or build tooling will handle it). If using CJSrequire, the plugin usually comes back as the function directly. - If both import and require fail, open an issue on the plugin repo or fix by forking/patching.
Next steps I can run for you (pick one):
- Run the interop script here in the workspace (requires installed node_modules).
- Try dynamic import checks and report results for the plugin list.
Repository scan notes
- The repository contains test helpers that import internal upstream
markdown-itfiles (only intest/original/*), for example:test/original/token.mjsimports../../../markdown-it/lib/token.mjstest/original/ruler.mjsimports../../../markdown-it/lib/ruler.mjstest/original/utils.mjsimports../../../markdown-it/lib/common/utils.mjs
These are test-only references and indicate the project runs some upstream tests by pointing to a local upstream checkout. They do not affect normal plugin usage, but they do illustrate that any code relying on upstream private paths will break if upstream files are moved or re-exported differently.