question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Paragraph tag adjacent to an img tag doesn't convert to custom component, any solution?

See original GitHub issue

I 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.

Screenshot from 2020-11-11 23-15-41

Screenshot from 2020-11-11 23-11-04

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
coreywardcommented, Nov 22, 2020

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.

0reactions
coreywardcommented, Nov 11, 2021

@Ardhimas You might find some of the approaches in https://github.com/probablyup/markdown-to-jsx/issues/209 useful.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found