diff --git a/src/index.js b/src/index.js index b4f295a..9ddd0d4 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ export default function parse(md, prevLinks) { } // Code/Indent blocks: else if (token[3] || token[4]) { - chunk = '
'+outdent(encodeAttr(token[3] || token[4]).replace(/^\n+|\n+$/g, ''))+'
'; + chunk = '
'+outdent(encodeAttr(token[3] || token[4]).replace(/^\n+|\n+$/g, ''))+'
'; } // > Quotes, -* lists: else if (token[6]) { diff --git a/test/index.js b/test/index.js index 3cbb234..1b5ab99 100644 --- a/test/index.js +++ b/test/index.js @@ -116,7 +116,7 @@ describe('snarkdown()', () => { it('parses three backtricks (```) as a code block', () => { expect(snarkdown('```\nfunction codeBlocks() {\n\treturn "Can be inserted";\n}\n```')).to.equal('
function codeBlocks() {\n\treturn "Can be inserted";\n}
'); - expect(snarkdown('```js\nfunction codeBlocks() {\n\treturn "Can be inserted";\n}\n```')).to.equal('
function codeBlocks() {\n\treturn "Can be inserted";\n}
'); + expect(snarkdown('```js\nfunction codeBlocks() {\n\treturn "Can be inserted";\n}\n```')).to.equal('
function codeBlocks() {\n\treturn "Can be inserted";\n}
'); }); it('parses tabs as a code poetry block', () => {