mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Reimplement MD021/no-multiple-space-closed-atx using micromark tokens.
This commit is contained in:
parent
e3ca9b1755
commit
0b165c1566
8 changed files with 393 additions and 219 deletions
|
|
@ -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.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue