mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Expose shared.js helper code for custom rule authors (fixes #134).
This commit is contained in:
parent
f614f3e1ce
commit
7e980401b8
52 changed files with 283 additions and 184 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addErrorDetailIf } = require("../helpers");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD002", "first-heading-h1", "first-header-h1" ],
|
||||
|
|
@ -13,7 +13,7 @@ module.exports = {
|
|||
const tag = "h" + level;
|
||||
params.tokens.every(function forToken(token) {
|
||||
if (token.type === "heading_open") {
|
||||
shared.addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
|
||||
addErrorDetailIf(onError, token.lineNumber, tag, token.tag);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue