doc/markdownlint-rules-grav-pages/tests/valid-images.spec.js
OniriCorpe 7a01793062
Improve markdown formatting of pages, a lot of them are improperly formatted (#2429)
* Revert "Revert "markdown format""

* fix formating

* fix readme

* add .markdownlint.json

* add markdownlint-rules-grav-pages

* add markdownlint-rules-grav-pages files

* add license for Markdown Lint Rules for Grav Pages

* fix [figure] mess

* fix [figure] mess 2

* fix [figure] mess 3

* maj .gitignore

* various fixes

* fix markdownlint-rules-grav-pages

* second formater pass

* various manual fixes

* add .markdownlintignore

* markdownlintignore: auto-generated pages

* disable proper-names for html_elements

* another bunch of various markdown fixes

* Update pages/02.administer/10.install/20.dns_config/dns_config.es.md

Co-authored-by: tituspijean <titus+yunohost@pijean.ovh>

---------

Co-authored-by: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com>
Co-authored-by: tituspijean <titus+yunohost@pijean.ovh>
2024-03-23 08:59:52 +01:00

31 lines
1.1 KiB
JavaScript

const markdownlint = require('markdownlint');
const validImagesRule = require('../rules/valid-images');
test('validate images', () => {
const src = `${__dirname}/assets/valid-images/test.md`;
const results = markdownlint.sync({
customRules: validImagesRule,
files: [src],
});
expect(results[src]).toEqual([
{
lineNumber: 13,
ruleNames: ['valid-images'],
ruleDescription: 'Rule that reports if a file has valid image references',
ruleInformation: null,
errorDetail: 'Image src \'test.invalid\' does not link to a valid file.',
errorContext: '![AltText](test.invalid)',
errorRange: null,
},
{
lineNumber: 17,
ruleNames: ['valid-images'],
ruleDescription: 'Rule that reports if a file has valid image references',
ruleInformation: null,
errorDetail: 'Image src \'../invalid/test.image\' does not link to a valid file.',
errorContext: '![AltText](../invalid/test.image)',
errorRange: null,
},
]);
});