Closed co3k closed 9 years ago
try the following test case by executing npm test then you will see the FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory.
npm test
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
diff --git a/test.js b/test.js index 11940ee..db746ed 100644 --- a/test.js +++ b/test.js @@ -103,5 +103,27 @@ describe('markdown-it-header-sections', function(){ var res = md.render(src); assert.equal(expected, res); }); + it('should parse incorrect order of headers', function(){ + var src = multiline.stripIndent(function(){/* + #### Header 4 + Text. + ### Header 3 + Hello! + */}); + var expected = multiline.stripIndent(function(){/* + <section> + <h4>Header 4</h4> + <p>Text.</p> + <section> + <h3>Header 3</h3> + <p>Hello!</p> + </section> + </section> + + */}); + md.use(headerSections); + var res = md.render(src); + assert.equal(expected, res); + }); });
try the following test case by executing
npm test
then you will see theFATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory
.