Add MD011 with tests, pass empty env to markdown-it.parse.

This commit is contained in:
David Anson 2015-03-03 18:28:59 -08:00
parent 812f5bdfff
commit f35d690fb1
3 changed files with 26 additions and 1 deletions

View file

@ -194,6 +194,24 @@ module.exports = [
}
},
{
"name": "MD011",
"desc": "Reversed link syntax",
"func": function MD011(params, errors) {
params.tokens.filter(function filterToken(token) {
return (token.type === "inline");
}).forEach(function forToken(token) {
token.children.filter(function filterChild(child) {
return (child.type === "text");
}).forEach(function forChild(child) {
if (child.content.match(/\([^)]+\)\[[^\]]+\]/)) {
errors.push(token.lineNumber);
}
});
});
}
},
{
"name": "MD031",
"desc": "Fenced code blocks should be surrounded by blank lines",