debian-mirror-gitlab/doc/.markdownlint/rules/tabs_title_text.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
666 B
JavaScript
Raw Normal View History

2023-04-23 21:23:45 +05:30
const { forEachLine, getLineMetadata, isBlankLine } = require(`markdownlint-rule-helpers`);
2023-01-13 00:05:48 +05:30
module.exports = {
names: ['tabs-title-text'],
description: 'Tab without title text',
information: new URL('https://docs.gitlab.com/ee/development/documentation/styleguide/#tabs'),
tags: ['gitlab-docs', 'tabs'],
function: (params, onError) => {
forEachLine(getLineMetadata(params), (line, lineIndex) => {
if (!isBlankLine(line) && line.replace(':::TabTitle', '').trim() === '') {
onError({
lineNumber: lineIndex + 1,
detail: 'Expected: :::TabTitle <your title here>; Actual: :::TabTitle',
});
}
});
},
};