Skip to content

Some inputs taking long time to parse #273

@manunio

Description

@manunio

Hi, While fuzzing using jazzer.js (for oss-fuzz) Parser().parse() was taking longer than exptected time to parse.

const commonmark = require('./dist/commonmark.js');

console.time("test")
const data = `---
pedaommen-

 >-t<!--
	This is another comm| baz | boParagraph two.

<!-- ntic: true
---

Just a [URL](/url/).

[URL and title](/url/ "title").

[URL and ttle](/url/ "title").

[URL and title](/url/  "title preceded by two spaces").

[URL and title](/url/	"title precede/ "title has spaces afterward"  ).

[URL and title]( e]( /url/has space/ "url has space and title").

[Empty]().`

new commonmark.Parser().parse(data)
console.timeEnd("test")
node test.js
test: 2:35.008 (m:ss.mmm)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions