-
Notifications
You must be signed in to change notification settings - Fork 16
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
Are image elements supported? #16
Comments
I use this plugin with [react-markdown](https://github.com/rexxars/react-markdown)
I can't seem to get attributes for images, other elements such as `<em/>` work fine
Are images supported?
Good new, images are supported.
Img is not listed in supported.elements but the readme includes the following example:
Img is not listed in supported.elements for technical reasons if I
remember. link and img are the same thing from the point of view of remark.
I think that this is a point of confusion and should be clarified ASAP
in the documentation.
What is your problem with images ? ^^
You can extend images with the option : `{extend: {image: ['your-attr']}}`. Standard attributes are supported by default, so is `height`.
|
@arobase-che thanks for quick reply! 🌹 my problem is that the attributes does not seem to be picked up by my custom renderer function in react-markdown for images. For other elements such as em it works fine. Issue might very well be specific to my use-case (react-markdown) though. Below does not work:
Below works fine:
|
@arobase-che thanks for quick reply! 🌹
Your are welcome. 💚
Issue might very well be specific to my use-case (react-markdown) though. Do you have a snippet you could share to conversion from cmd-line or node?
It may be. :s
remark-attr is intent to be used with rehype.
Can you share a minimal _non-_working example ? ^^
What you have already shared seems to work. [Here](https://runkit.com/embed/xvx12zvlwmu7) is my test.
Below works fine:
```
Npm stand for *node*{style="color:red"} packet manager.
```
Cool ! :D
Giving hope that it's just a little mistake that can be quickly fixed.
Edit: Sry email replies do not support Markdown and I wasn't aware of that. 😞
|
That's unfortunate. |
Thank you @mrm007 ! I understand the problem but can do anything from my side. I don't understand why they don't pass hProperties to react. |
@mrm007 you sir, are correct! thank you for the pointers. I´ve opened an issue to pass hProperties to renderers. @arobase-che upon further investigation I realized that this behavior applies to all element types. like @mrm007 pointed out it's an issue with react-markdown. Thanks again guys 🎁 |
@arobase-che upon further investigation I realized that this behavior applies to all element types. like @mrm007 pointed out it's an issue with react-markdown.
Sorry :/
I will follow the issue. I wish I can add your use case to the tests.
|
I use this plugin with react-markdown
I can't seem to get attributes for images, other elements such as
<em/>
work fineAre images supported?
Img is not listed in supported.elements but the readme includes the following example:
The text was updated successfully, but these errors were encountered: