Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tabs_title_text.js « rules « .markdownlint « doc - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 672aa70f5624427a05d90c749ceccf650f990cd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const { globalPath } = require('../require_helper');
const {
  forEachLine,
  getLineMetadata,
  isBlankLine,
} = require(`${globalPath}/markdownlint-rule-helpers`);

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',
        });
      }
    });
  },
};