-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
How to override render method of <img> #774
Comments
I think I have a similar issue with Example: 1. Block
2. Inline
|
@fxha Inline HTML is just plain text according to the commonmark spec so the only way to modify it would be to search for it before passing the string to marked. const md = `foo
foo  bar <img src="./img1.png"> foobar
bar`;
md.replace(/<img .*?>/, 'Something else');
marked(md); |
Depending on your use case, you might want to filter out all images by using an allow-list of html tags See this comment |
I want to override method of
<img>
, However, I find that<img>
is not recognized as html.the following method is which I override:
so, which part should be override ?
The text was updated successfully, but these errors were encountered: