mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add MD002 with test, incorporate markdown-it parser.
This commit is contained in:
parent
5d35b8dfea
commit
82caaa9407
6 changed files with 29 additions and 5 deletions
1
test/first_header_bad_atx.md
Normal file
1
test/first_header_bad_atx.md
Normal file
|
|
@ -0,0 +1 @@
|
|||
## Header {MD002}
|
||||
2
test/first_header_bad_setext.md
Normal file
2
test/first_header_bad_setext.md
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Header {MD002}
|
||||
--------------
|
||||
|
|
@ -12,7 +12,7 @@ function createTestForFile(file) {
|
|||
{ "encoding": "utf8" },
|
||||
function readFileCallback(err, contents) {
|
||||
test.ifError(err);
|
||||
var lines = contents.split(/\r\n|\n/g);
|
||||
var lines = contents.split(/\r\n|\r|\n/g);
|
||||
var results = {};
|
||||
lines.forEach(function forLine(line, lineNum) {
|
||||
var match = line.match(/\{(MD\d+)(?::(\d+))?\}/);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue