2018-02-15 21:35:58 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2018-02-25 16:04:13 -08:00
|
|
|
"names": [ "any-blockquote" ],
|
|
|
|
|
"description": "Rule that reports an error for any blockquote",
|
2018-02-15 21:35:58 -08:00
|
|
|
"tags": [ "test" ],
|
|
|
|
|
"function": function rule(params, onError) {
|
|
|
|
|
params.tokens.filter(function filterToken(token) {
|
|
|
|
|
return token.type === "blockquote_open";
|
|
|
|
|
}).forEach(function forToken(blockquote) {
|
|
|
|
|
var lines = blockquote.map[1] - blockquote.map[0];
|
|
|
|
|
onError({
|
|
|
|
|
"lineNumber": blockquote.lineNumber,
|
|
|
|
|
"detail": "Blockquote spans " + lines + " line(s).",
|
2018-02-27 21:14:02 -08:00
|
|
|
"context": blockquote.line.substr(0, 7)
|
2018-02-15 21:35:58 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|