Extra empty line at the start of the code block
See original GitHub issueLooks like prism reads the newline after <pre><code>
and highlights it. Any way to disable that? In normal usage, we have a newline between <pre><code>
and the code, and we probably don’t want to display it:
<pre><code class="language-javascript">
console.log('Hello world');
</code></pre>
The output starts with that empty line:
Of course, I could write
<pre><code class="language-javascript">console.log('Hello world');
</code></pre>
but that’s ugly in the source.
Issue Analytics
- State:
- Created 9 years ago
- Comments:27 (23 by maintainers)
Top Results From Across the Web
How can I eliminate the empty line in code blocks rendered by ...
Basically, the whitespace inside <pre> is not trimmed, and be treated as a newline in the rendered page (you can use firebug extension...
Read more >How do you use blank lines in your code?
Blank lines are for opening sections of the code to work on, you have a couple hotkeys in your editor to take you...
Read more >Copy paste in code block double the empty lines
Hello, When I copy code from an editor (Notepad+++, PyCharm etc.) and paste it into an Evernote code block, all empty lines are...
Read more >Editor creates extraneous newlines when formatting blocks - Jira
When using the Rich Text Editor Visual mode, editing block of text into a format (e.g.: Code), it will add an extra newline....
Read more >How to display multiple blank lines in Markdown
It fools the rendering code into adding a visually empty <p> </p> tag giving you an extra empty line. You can add as...
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
The removal of the initial line feed has been moved from core to a plugin: http://prismjs.com/plugins/remove-initial-line-feed/
This is now located in the normalize whitespace plugin https://prismjs.com/plugins/normalize-whitespace/