2018-01-21 21:44:25 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
2019-04-13 11:18:57 -07:00
|
|
|
const { addErrorContext, filterTokens } = require("../helpers");
|
2018-01-21 21:44:25 -08:00
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
"names": [ "MD040", "fenced-code-language" ],
|
|
|
|
|
"description": "Fenced code blocks should have a language specified",
|
|
|
|
|
"tags": [ "code", "language" ],
|
|
|
|
|
"function": function MD040(params, onError) {
|
2019-04-13 11:18:57 -07:00
|
|
|
filterTokens(params, "fence", function forToken(token) {
|
2018-01-21 21:44:25 -08:00
|
|
|
if (!token.info.trim()) {
|
2019-04-13 11:18:57 -07:00
|
|
|
addErrorContext(onError, token.lineNumber, token.line);
|
2018-01-21 21:44:25 -08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|