Support paren vs. dot for ordered list markers per CommonMark specification.

This commit is contained in:
David Anson 2016-10-16 21:51:49 -07:00
parent 557c5942ea
commit 3a356467cd
4 changed files with 33 additions and 1 deletions

View file

@ -625,7 +625,7 @@ module.exports = [
if (!list.unordered) {
var number = 1;
list.items.forEach(function forItem(item) {
var re = new RegExp("^[\\s>]*" + String(number) + "\\.");
var re = new RegExp("^[\\s>]*" + String(number) + "[\\.)]");
if (!re.test(item.line)) {
errors.push(item.lineNumber);
}

View file

@ -0,0 +1,13 @@
Good list:
1) Do this.
1) Do that.
1) ???
1) Profit!
Bad list:
1) Do this.
2) Do nothing. {MD029}
3) ??? {MD029}
4) Failed! {MD029}

View file

@ -0,0 +1,6 @@
{
"default": true,
"MD029": {
"style": "ordered"
}
}

View file

@ -0,0 +1,13 @@
Good list:
1) Do this.
2) Do that.
3) ???
4) Profit!
Bad list:
1) Do this.
1) Do nothing. {MD029}
1) ??? {MD029}
1) Failed! {MD029}