Skip to content

Commit

Permalink
Merge pull request #1670 from devoto13/code-newline
Browse files Browse the repository at this point in the history
  • Loading branch information
UziTech committed May 11, 2020
2 parents a1679fa + 13b0c07 commit 31f8379
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Renderer.js
Expand Up @@ -25,7 +25,7 @@ module.exports = class Renderer {
if (!lang) {
return '<pre><code>'
+ (escaped ? code : escape(code, true))
+ '</code></pre>';
+ '</code></pre>\n';
}

return '<pre><code class="'
Expand Down
3 changes: 2 additions & 1 deletion test/specs/new/code_compensation_indent.html
Expand Up @@ -2,5 +2,6 @@
<ol>
<li><p>This is a list element.</p>
<pre><code>const x = 5;
const y = x + 5;</code></pre></li>
const y = x + 5;</code></pre>
</li>
</ol>
3 changes: 3 additions & 0 deletions test/specs/new/code_consistent_newline.html
@@ -0,0 +1,3 @@
<pre><code class="language-js">const value = 42;</code></pre>
<pre><code>const value = 42;</code></pre>
<p>Code blocks contain trailing new line.</p>
10 changes: 10 additions & 0 deletions test/specs/new/code_consistent_newline.md
@@ -0,0 +1,10 @@
---
renderExact: true
---
```js
const value = 42;
```

const value = 42;

Code blocks contain trailing new line.

1 comment on commit 31f8379

@vercel
Copy link

@vercel vercel bot commented on 31f8379 May 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.