mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD009/no-trailing-spaces to include strict mode (fixes #216).
This commit is contained in:
parent
a9251c533f
commit
6f3c67f760
10 changed files with 193 additions and 11 deletions
6
test/hard-line-breaks.json
Normal file
6
test/hard-line-breaks.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD009": {
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
64
test/hard-line-breaks.md
Normal file
64
test/hard-line-breaks.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# Hard Line Breaks
|
||||
|
||||
hard
|
||||
break
|
||||
|
||||
hard\
|
||||
break
|
||||
|
||||
hard
|
||||
break
|
||||
|
||||
hard
|
||||
break
|
||||
|
||||
hard\
|
||||
break
|
||||
|
||||
*hard
|
||||
break*
|
||||
|
||||
*hard\
|
||||
break*
|
||||
|
||||
`code
|
||||
span`
|
||||
|
||||
`code\
|
||||
span`
|
||||
|
||||
not\
|
||||
|
||||
not
|
||||
|
||||
## not\
|
||||
|
||||
### not
|
||||
|
||||
- Item
|
||||
|
||||
- Item
|
||||
|
||||
- Item
|
||||
|
||||
- Item
|
||||
|
||||
Text text
|
||||
text `code
|
||||
span code
|
||||
span` text
|
||||
text
|
||||
|
||||
Text text
|
||||
text text
|
||||
text
|
||||
|
||||
{MD009:9}
|
||||
{MD009:24}
|
||||
{MD009:32}
|
||||
{MD009:36}
|
||||
{MD009:39}
|
||||
{MD009:41}
|
||||
{MD009:43}
|
||||
{MD009:48}
|
||||
{MD009:54}
|
||||
|
|
@ -1553,6 +1553,7 @@ module.exports.doc = function doc(test) {
|
|||
ruleUsesParams = ruleUsesParams.map(function forUse(use) {
|
||||
return use.split(".").pop();
|
||||
});
|
||||
ruleUsesParams.sort();
|
||||
}
|
||||
} else if (/^Tags: /.test(token.content) && rule) {
|
||||
test.deepEqual(token.content.split(tagAliasParameterRe).slice(1),
|
||||
|
|
@ -1571,6 +1572,7 @@ module.exports.doc = function doc(test) {
|
|||
inDetails = inDetails || (part[0] === "(");
|
||||
return !inDetails;
|
||||
});
|
||||
parameters.sort();
|
||||
test.deepEqual(parameters, ruleUsesParams,
|
||||
"Missing parameter for rule " + rule.names);
|
||||
ruleUsesParams = null;
|
||||
|
|
|
|||
7
test/trailing-spaces-in-lists-allowed-strict.json
Normal file
7
test/trailing-spaces-in-lists-allowed-strict.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"default": true,
|
||||
"MD009": {
|
||||
"list_item_empty_lines": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
52
test/trailing-spaces-in-lists-allowed-strict.md
Normal file
52
test/trailing-spaces-in-lists-allowed-strict.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# Heading
|
||||
|
||||
1. text
|
||||
text
|
||||
1. text
|
||||
|
||||
text
|
||||
1. text
|
||||
|
||||
text
|
||||
1. text
|
||||
text
|
||||
|
||||
1. text
|
||||
text
|
||||
|
||||
1. text
|
||||
|
||||
{MD009:16}
|
||||
{MD009:18}
|
||||
|
||||
1. text
|
||||
text
|
||||
1. text
|
||||
|
||||
text
|
||||
1. text
|
||||
|
||||
text
|
||||
1. text
|
||||
text
|
||||
|
||||
1. text
|
||||
text
|
||||
|
||||
1. text
|
||||
|
||||
1. text
|
||||
- text
|
||||
|
||||
text
|
||||
- text
|
||||
|
||||
text
|
||||
- text
|
||||
text
|
||||
|
||||
- text
|
||||
text
|
||||
|
||||
{MD009:37}
|
||||
{MD009:50}
|
||||
Loading…
Add table
Add a link
Reference in a new issue