Improve code to determine unordered list style for MD004/ul-style (fixes #104).

This commit is contained in:
David Anson 2018-01-31 21:32:50 -08:00
parent c0ea22e55e
commit 056608a680
4 changed files with 61 additions and 38 deletions

View file

@ -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);