Comments (8)
from remark-attr.
@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:
![alt](img){ style="color:red" }
Below works fine:
Npm stand for *node*{style="color:red"} packet manager.
from remark-attr.
from remark-attr.
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.
That's unfortunate. react-markdown
won't pass the attributes down to your render function (see here). If you set a breakpoint on that line (assuming you have everything else configured correctly) you'll find node.data.hProperties
populated by this plugin, but the information doesn't make it to your image
renderer.
from remark-attr.
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.
from remark-attr.
@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 ๐
from remark-attr.
from remark-attr.
from remark-attr.
Related Issues (18)
- Fenced code? HOT 13
- Support attributes in the same line as an ATX heading? HOT 5
- Support spans with attributes? HOT 1
- Support for custom data attributes HOT 5
- Stop looking for attrs in the fenced code HOT 3
- Support for linkReference HOT 4
- Support angle-bracket links HOT 2
- Remove undefined values from hProperties HOT 1
- Tags not added on images with Docusaurus HOT 4
- remark@next (13) HOT 10
- ATX-style cannot specify attributes if the header has inline syntax HOT 1
- There is a bug HOT 4
- 'Missing parser to attach `remark-attr` [link] (to) HOT 3
- key/class/id support HOT 2
- classes? HOT 1
- [email protected] npm package missing dist/index.js file HOT 2
- Attribute for <p> / paragraph? HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from remark-attr.