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
Error TypeError: plugin.apply is not a function
#402
Comments
|
Thanks for creating the issue! I'll look into it as soon as I have some free time ✨ |
|
Thanks! 🙏 |
|
I see that you have imported the default, however This should work: const MarkdownIt = require("markdown-it");
const { markdownItImageSize } = require("markdown-it-image-size");
const md = new MarkdownIt();
md.use(MarkdownItImageSize);
let result = md.render(`# markdown-it rulezz!

`);
console.log(result);Working example: https://runkit.com/embed/myowsfrf5mph EDIT: Misclicked and closed the issue unwillingly. |
|
@boyum I guess there's a typo in your code with a lowercase initial in But anyway, I get the same error with |
|
No, the exported function is named |
|
But then you use |
|
Ooooh, it works when I use lowercase |
|
Ah, sorry for updating only the import, not inside |
|
i use it in my react project created base on vite, vite just support esm import {markdownItImageSize} from 'markdown-it-image-size';
// console.log(111, markdownItImageSize);
const md = MarkdownIt({
html: true,
linkify: true,
typographer: true,
}).use(markdownItImageSize);
/and find this error |
|
@dingshaohua-cn Please continue this conversation in #416. |
I'm trying to use
markdown-it-image-size13.1.1 withmarkdown-it13.0.1 and I get this error, whatever code I write:TypeError: plugin.apply is not a functionThis is a simple example:
Here's the error log:
The text was updated successfully, but these errors were encountered: