mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update MD003 to support setext_with_atx.
This commit is contained in:
parent
c2aff32460
commit
fd1215d143
4 changed files with 33 additions and 5 deletions
|
|
@ -173,10 +173,14 @@ module.exports = [
|
|||
"func": function MD003(params, errors) {
|
||||
var style = params.options.style || "consistent";
|
||||
filterTokens(params, "heading_open", function forToken(token) {
|
||||
var styleForToken = headingStyleFor(token);
|
||||
if (style === "consistent") {
|
||||
style = headingStyleFor(token);
|
||||
style = styleForToken;
|
||||
}
|
||||
if (headingStyleFor(token) !== style) {
|
||||
if ((styleForToken !== style) &&
|
||||
!((style === "setext_with_atx") &&
|
||||
(/h[12]/.test(token.tag) && (styleForToken === "setext")) ||
|
||||
(/h[^12]/.test(token.tag) && (styleForToken === "atx")))) {
|
||||
errors.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue