Reimplement MD021/no-multiple-space-closed-atx using micromark tokens.

This commit is contained in:
David Anson 2024-06-15 15:45:04 -07:00
parent e3ca9b1755
commit 0b165c1566
8 changed files with 393 additions and 219 deletions

View file

@ -300,17 +300,6 @@ function indentFor(token) {
}
module.exports.indentFor = indentFor;
// Returns the heading style for a heading token
module.exports.headingStyleFor = function headingStyleFor(token) {
if ((token.map[1] - token.map[0]) === 1) {
if (/[^\\]#\s*$/.test(token.line)) {
return "atx_closed";
}
return "atx";
}
return "setext";
};
/**
* Return the string representation of an unordered list marker.
*