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,16 +2,16 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addErrorContext, filterTokens } = require("../helpers");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD040", "fenced-code-language" ],
|
||||
"description": "Fenced code blocks should have a language specified",
|
||||
"tags": [ "code", "language" ],
|
||||
"function": function MD040(params, onError) {
|
||||
shared.filterTokens(params, "fence", function forToken(token) {
|
||||
filterTokens(params, "fence", function forToken(token) {
|
||||
if (!token.info.trim()) {
|
||||
shared.addErrorContext(onError, token.lineNumber, token.line);
|
||||
addErrorContext(onError, token.lineNumber, token.line);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue