Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (generated(node)) {
return;
}
if (next && isApplicable(node) && isApplicable(next)) {
if (node.type === 'heading' && next.type === 'heading') {
if (position.start(next).line !== position.end(node).line + 2) {
file.message('Incorrect number of blank lines between headings', node);
}
} else if (node.type === 'heading' && next.type !== 'heading') {
if (position.start(next).line - position.end(node).line !== 2) {
file.message('Incorrect number of blank lines between heading and section', node);
}
} else if (node.type === 'list') {
if (position.start(next).line - position.end(node).line !== 3) {
file.message('Incorrect number of blank lines between last section and next heading', node);
}
}
}
});
}
function check(node, pos, parent) {
var start = position.start(node)
var value
var index
var line
var cumulative
var indent
if (!applicable(node)) {
return
}
if (!start.line || !node.position.indent) {
first = false
return
}
if (first && ws(toString(node).charAt(0))) {
function check(node) {
var head = node.children[0]
var indentation = position.start(head).column - position.start(node).column
var padding = toString(head).match(/^ +/)
if (padding) {
indentation += padding[0].length
}
return indentation
}
if (generated(node)) {
return;
}
if (next && isApplicable(node) && isApplicable(next)) {
if (node.type === 'heading' && next.type === 'heading') {
if (position.start(next).line !== position.end(node).line + 2) {
file.message('Incorrect number of blank lines between headings', node);
}
} else if (node.type === 'heading' && next.type !== 'heading') {
if (position.start(next).line - position.end(node).line !== 2) {
file.message('Incorrect number of blank lines between heading and section', node);
}
} else if (node.type === 'list') {
if (position.start(next).line - position.end(node).line !== 3) {
file.message('Incorrect number of blank lines between last section and next heading', node);
}
}
}
});
}
function handleLinkError(file, link) {
const { line, column } = start(link.node);
file.warn(`Link is broken: ${link.link.href}`, { line, column });
}
function visitor(node) {
if (!generated(node) && node.depth === style) {
if (duplicate) {
file.message(
'Don’t use multiple top level headings (' + duplicate + ')',
node
)
} else {
duplicate = stringify(start(node))
}
}
}
}
function handleLinkDuplicateError(file, link) {
var _start = start(link.node);
var line = _start.line;
var column = _start.column;
file.warn('Link is a duplicate: ' + link.link.href, { line: line, column: column });
}
function each(row) {
var fence = contents.slice(
position.start(row).offset,
position.start(row.children[0]).offset
)
if (fence.indexOf('|') > 1) {
file.message(reason, row)
}
}
}