diff --git a/package.json b/package.json index 8e2e640..b80f208 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "babel-register": "^6.23.0", "chai": "^3.5.0", "eslint": "^3.16.1", - "microbundle": "^0.4.4", + "microbundle": "^0.12.0", "mocha": "^5.1.1" }, "eslintConfig": { diff --git a/src/index.js b/src/index.js index 8e40bf8..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 8e8aaac..1b5ab99 100644
--- a/test/index.js
+++ b/test/index.js
@@ -114,18 +114,18 @@ 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('```\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', () => {
- expect(snarkdown('\tvar a = 1')).to.equal('var a = 1'); + expect(snarkdown('\tvar a = 1')).to.equal('
var a = 1
');
});
it('escapes code/quote blocks', () => {
- expect(snarkdown('```\n<foo>'); - expect(snarkdown('\t
<foo>'); + expect(snarkdown('```\n
<foo>
');
+ expect(snarkdown('\t<foo>
');
});
it('parses a block quote', () => {