Paragraph tag adjacent to an img tag doesn't convert to custom component, any solution?
See original GitHub issueI am using this package for my blog page and I’m overriding all the html tags to be converted to my custom components, everything is being converted fine except one <p>
tag which is just after an <img>
tag, I don’t understand why is this happening.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Render HTML to an image - javascript - Stack Overflow
create an SVG with a foreignObject node containing your XHTML; set the src of an image to the data url of that SVG...
Read more >Using the image tag in React - Dave Ceddia
I'm talking about the plain old <img src=""/> tag here. The same one you'd use in HTML. When you img in a React...
Read more >Using custom elements - Web Components | MDN
Optional An options object containing an extends property, which specifies the built-in element your element inherits from, if any (only ...
Read more >HTML Tag: Change The Width Of A Picture In HTML »
Images: Complete discussion of WIDTH and HEIGHT for the IMG tag. Includes percentages, stretching/shrinking, and if these attributes are really required ...
Read more >Setting Height And Width On Images Is Important Again
To prevent layout shifts and improve performance scores, we need to always set width and height attributes on our images.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve encountered this before, and from what I recall, it isn’t markdown-to-jsx creating the second, classless
<p>
, but instead the browser is doing so implicitly when it encounters the block-level<div>
wrapping the<img>
followed immediately by inline text.@Ardhimas You might find some of the approaches in https://github.com/probablyup/markdown-to-jsx/issues/209 useful.