UNPKG

@diplodoc/transform

Version:

A simple transformer of text in YFM (Yandex Flavored Markdown) to HTML

33 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.yfm003 = void 0; exports.yfm003 = { names: ['YFM003', 'unreachable-link'], description: 'Link is unreachable', tags: ['links'], function: function YFM003(params, onError) { const { config } = params; if (!config) { return; } params.tokens .filter((token) => { return token.type === 'inline'; }) .forEach((inline) => { var _a; (_a = inline.children) === null || _a === void 0 ? void 0 : _a.filter((child) => { return child.type === 'link_open'; }).forEach((link) => { // @ts-expect-error bad markdownlint typings if (link.attrGet('YFM003')) { onError({ lineNumber: link.lineNumber, context: link.line, }); } }); }); }, }; //# sourceMappingURL=yfm003.js.map