Make markdown parser more safe (#4105)

Fixes #3722
This commit is contained in:
Rocknest 2020-01-07 22:26:21 +02:00 committed by Andrew Kelley
parent 3607d9ee68
commit 437c6a4b7e

View File

@ -1432,7 +1432,7 @@
line.type = "ul";
line.text = line.text.substr(1);
}
else if (line.text.match(/\d+\./)) {
else if (line.text.match(/^\d+\..*$/)) { // if line starts with {number}{dot}
const match = line.text.match(/(\d+)\./);
line.type = "ul";
line.text = line.text.substr(match[0].length);