mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Improve code to determine unordered list style for MD004/ul-style (fixes #104).
This commit is contained in:
parent
c0ea22e55e
commit
056608a680
4 changed files with 61 additions and 38 deletions
|
|
@ -100,19 +100,6 @@ module.exports.headingStyleFor = function headingStyleFor(token) {
|
|||
return "setext";
|
||||
};
|
||||
|
||||
// Returns the unordered list style for a list item token
|
||||
module.exports.unorderedListStyleFor = function unorderedListStyleFor(token) {
|
||||
switch (trimLeft(token.line).substr(0, 1)) {
|
||||
case "-":
|
||||
return "dash";
|
||||
case "+":
|
||||
return "plus";
|
||||
// case "*":
|
||||
default:
|
||||
return "asterisk";
|
||||
}
|
||||
};
|
||||
|
||||
// Calls the provided function for each matching token
|
||||
function filterTokens(params, type, callback) {
|
||||
(params.tokenLists[type] || []).forEach(callback);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue