prism: Extra empty line at the start of the code block

Looks 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:

image

Of course, I could write

<pre><code class="language-javascript">console.log('Hello world');
</code></pre>

but that’s ugly in the source.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 27 (23 by maintainers)

Commits related to this issue

Most upvoted comments

The removal of the initial line feed has been moved from core to a plugin: http://prismjs.com/plugins/remove-initial-line-feed/