mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update MD004/ul-style to handle invalid "style" parameter values.
This commit is contained in:
parent
77217ce33e
commit
a92da33235
3 changed files with 24 additions and 1 deletions
|
|
@ -11,12 +11,12 @@ const expectedStyleToMarker = {
|
|||
"plus": "+",
|
||||
"asterisk": "*"
|
||||
};
|
||||
|
||||
const differentItemStyle = {
|
||||
"dash": "plus",
|
||||
"plus": "asterisk",
|
||||
"asterisk": "dash"
|
||||
};
|
||||
const validStyles = Object.keys(expectedStyleToMarker);
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD004", "ul-style" ],
|
||||
|
|
@ -43,6 +43,9 @@ module.exports = {
|
|||
}
|
||||
expectedStyle = nestingStyles[nesting];
|
||||
}
|
||||
if (!validStyles.includes(expectedStyle)) {
|
||||
expectedStyle = validStyles[0];
|
||||
}
|
||||
let range = null;
|
||||
let fixInfo = null;
|
||||
const match = item.line.match(listItemMarkerRe);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue