Line of text w/o line break wraps with span instead of P
See original GitHub issueHaving an issue where a string of text within the Markdown component that does not contain a line break gets wrapped with a <span>
tag instead of what I would expect a <p>
tag.
I took some screen shots highlighting the text from your demo site, you’ll notice the one with the line break produces a P tag, the other does not.
I would expect that any string, even if it doesn’t contain a line break would be wrapped in a P tag unless a markdown or html modifier is supplied. I believe this is how Markdown is supposed to behave.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Wrap entire span on new line if doesn't fit
The <span> tag is inline by default, so the text inside will break when wrapping happens. You can set it to display: inline-block...
Read more >overflow-wrap - CSS: Cascading Style Sheets - MDN Web Docs
The overflow-wrap CSS property applies to inline elements, ... Lines may only break at normal word break points (such as a space between...
Read more >overflow-wrap
The overflow-wrap property in CSS allows you to specify that the browser can break a line of text inside the targeted element onto...
Read more >The right way to use break tags in HTML
This text is separated from the text above by a single line space. </p>. But this content would really be better marked up...
Read more >Deep Dive into Text Wrapping and Word Breaking
For line breaks, you can use <br> inside of an element with white-space: nowrap or white-space: pre just fine. The text will wrap....
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
Yeah, totally get why you did that, but it is kind of unintuitive and doesn’t behave as you would expect. I’m going to close this as the option seems to have fixed my issue (RTFD!).
Thanks again!
https://github.com/probablyup/markdown-to-jsx/pull/167