mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Add br_spaces parameter to MD009.
This commit is contained in:
parent
0e24df7cf7
commit
9acbb2750e
4 changed files with 25 additions and 1 deletions
|
@ -237,8 +237,11 @@ module.exports = [
|
|||
"desc": "Trailing spaces",
|
||||
"tags": [ "whitespace" ],
|
||||
"func": function MD009(params, errors) {
|
||||
var brSpaces = params.options.br_spaces || 0;
|
||||
params.lines.forEach(function forLine(line, lineIndex) {
|
||||
if (/\s$/.test(line)) {
|
||||
if (/\s$/.test(line) &&
|
||||
((brSpaces < 2) ||
|
||||
(line.length - line.trimRight().length !== brSpaces))) {
|
||||
errors.push(lineIndex + 1);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue