Pre-formatted text loses line breaks
See original GitHub issuePre-formatted text loses line breaks
Multi-line text inside a <pre>
block seems to loose line breaks.
Your environment
- OS: Microsoft Windows [Version 10.0.19041.264]
- Packages: https://github.com/PedroLamas/pedrolamas.com/blob/master/package.json#L42
- Env: yarn 1.7
Steps to reproduce
On any markdown file, just add the following:
<pre>
line 1
line 2
</pre>
Expected behaviour
Expected rendered HTML to be:
<pre>
line 1
line 2
</pre>
Actual behaviour
Rendered HTML is:
<pre>line 1 line 2</pre>
So line breaks are missing!
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (12 by maintainers)
Top Results From Across the Web
Line breaks are removed in posts made in plain text format
Method 1 - Disable the feature that removes extra line breaks · Open Outlook. · On the Tools menu, select Options. · On...
Read more >Pasting into prefotmatted box removes line breaks - Jira
Issue Summary. When copying some texts into a preformatted box, in some situations it removes the line breaks. Steps to Reproduce.
Read more >Losing line break when displaying text - Stack Overflow
Use the pre tag and the new lines will be respected. pre is for preformatted text and will use non-proportional font so it...
Read more >How to Preserve Newlines, Line Breaks, and Whitespace in ...
For example, a text from a textarea may contain line breaks or empty lines. The white-space CSS property is helpful displaying the text...
Read more >Using Preformatted Text | Working with Text in HTML5 - Peachpit
The pre element is ideal for text that contains important spaces and line breaks, like the bit of CSS code shown here. Note,...
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 FreeTop 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
Top GitHub Comments
Thanks, @wooorm!
I figured it out:
Note the quoting expression:
and the
$
on the bracketed variable substitutions (${...}
instead of{...}
).Assuming a
versions.js
of:Yes it matters. MDX is JSX first.