Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function buildPipeline(target) {
const base = unified()
.use(markdown)
.use(toc)
.use(slug)
.use(autolink)
.use(validateLinks)
.use({
plugins: styleGuide.plugins.filter(elem => {
if (!Array.isArray(elem))
return elem;
return elem[0].displayName !== 'remark-lint:list-item-indent'
})
})
.use(highlight, makeHighlightOptions(target))
.use(
remark2retext,
unified()
.use(english)
.use(indefiniteArticle)
.use(repeatedWords)
)
switch (target) {
case 'html':
commonmark: true,
looseTable: false,
spacedTable: false,
paddedTable: false,
fences: true,
rule: '-',
ruleRepetition: 3,
emphasis: "*",
strong: "*",
bullet: "-",
listItemIndent: 'tab',
incrementListMarker: true
};
const remarkPresetLintMarkdownStyleGuide = {
plugins: require("remark-preset-lint-markdown-style-guide").plugins.filter(
function(elem) {
return elem != require("remark-lint-no-duplicate-headings");
}
)
};
exports.plugins = [
require("remark-preset-lint-consistent"),
require("remark-preset-lint-recommended"),
remarkPresetLintMarkdownStyleGuide,
[require("remark-lint-no-dead-urls"), { skipOffline: true }],
require("remark-lint-heading-whitespace"),
[require("remark-lint-maximum-line-length"), 120],
[require("remark-lint-maximum-heading-length"), 120],
[require("remark-lint-list-item-indent"), "tab-size"],
[require("remark-lint-list-item-spacing"), false],