diff --git a/src/markdownSyntaxHighlight.js b/src/markdownSyntaxHighlight.js index 71be334..d909d7c 100644 --- a/src/markdownSyntaxHighlight.js +++ b/src/markdownSyntaxHighlight.js @@ -26,20 +26,16 @@ module.exports = function(str, language) { let highlights = new HighlightLinesGroup(split.join("/"), "/"); - let lines = html.split("\n"); + let lines = html.split("\n").slice(0, -1); // The last line is empty. let highlightedLines = lines.map(function(line, j) { - if( j + 1 === lines.length ) { - return ""; - } - - return "
" + line + - "
"; + ""; }); - return `
${highlightedLines.join("")}
`; + return `
${highlightedLines.join("
")}
`; };