mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Support paren vs. dot for ordered list markers per CommonMark specification.
This commit is contained in:
parent
557c5942ea
commit
3a356467cd
4 changed files with 33 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
13
test/ordered_list_item_prefix-paren.md
Normal file
13
test/ordered_list_item_prefix-paren.md
Normal 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}
|
6
test/ordered_list_item_prefix_ordered-paren.json
Normal file
6
test/ordered_list_item_prefix_ordered-paren.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD029": {
|
||||
"style": "ordered"
|
||||
}
|
||||
}
|
13
test/ordered_list_item_prefix_ordered-paren.md
Normal file
13
test/ordered_list_item_prefix_ordered-paren.md
Normal 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}
|
Loading…
Add table
Add a link
Reference in a new issue