authorgravatar for 35231115+Rocknest@users.noreply.github.comRocknest <35231115+Rocknest@users.noreply.github.com> 2020-01-07 22:26:21+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-01-07 15:26:21-05:00
log437c6a4b7ef115208ae84a938f989b92fb282c39
tree388336bcde4bab38ce90eb46545512e513abe899
parent3607d9ee6821f524e2866f8ca44a5d577495d762

Make markdown parser more safe (#4105)

Fixes #3722

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/special/docs/main.js+1-1
...@@ -1432,7 +1432,7 @@...@@ -1432,7 +1432,7 @@
1432 line.type = "ul";1432 line.type = "ul";
1433 line.text = line.text.substr(1);1433 line.text = line.text.substr(1);
1434 }1434 }
1435 else if (line.text.match(/\d+\./)) {1435 else if (line.text.match(/^\d+\..*$/)) { // if line starts with {number}{dot}
1436 const match = line.text.match(/(\d+)\./);1436 const match = line.text.match(/(\d+)\./);
1437 line.type = "ul";1437 line.type = "ul";
1438 line.text = line.text.substr(match[0].length);1438 line.text = line.text.substr(match[0].length);