Update MD040/fenced-code-language to add language_only parameter to reject extra data in info string.

This commit is contained in:
Sébastien Règne 2022-11-11 07:07:04 +01:00 committed by GitHub
parent 718de432f3
commit 72439f42c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 176 additions and 1 deletions

View file

@ -29553,6 +29553,99 @@ Generated by [AVA](https://avajs.dev).
`,
}
## md040-language_only.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: 0 or 2; Actual: 1',
errorRange: [
7,
1,
],
fixInfo: {
deleteCount: 1,
editColumn: 7,
},
lineNumber: 11,
ruleDescription: 'Trailing spaces',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md009.md',
ruleNames: [
'MD009',
'no-trailing-spaces',
],
},
{
errorContext: null,
errorDetail: 'Info string contains more than language: " html"',
errorRange: null,
fixInfo: null,
lineNumber: 5,
ruleDescription: 'Fenced code blocks should have a language specified',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md',
ruleNames: [
'MD040',
'fenced-code-language',
],
},
{
errorContext: null,
errorDetail: 'Info string contains more than language: "css "',
errorRange: null,
fixInfo: null,
lineNumber: 11,
ruleDescription: 'Fenced code blocks should have a language specified',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md',
ruleNames: [
'MD040',
'fenced-code-language',
],
},
{
errorContext: null,
errorDetail: 'Info string contains more than language: "html version=5"',
errorRange: null,
fixInfo: null,
lineNumber: 17,
ruleDescription: 'Fenced code blocks should have a language specified',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md040.md',
ruleNames: [
'MD040',
'fenced-code-language',
],
},
],
fixed: `# md040-language_only.md␊
Fence code block information with leading whitespace:␊
\`\`\` html␊
<h1>markdownlint</h1> {MD040:5}␊
\`\`\`␊
Fence code block information with trailing whitespace:␊
\`\`\`css␊
body {} {MD040:11} {MD009:11}␊
\`\`\`␊
Fence code block information with extra data:␊
\`\`\`html version=5␊
<title>MarkdownLint</title> {MD040:17}␊
\`\`\`␊
Fence code block information without whitespaces and extra data:␊
\`\`\`css␊
a {}␊
\`\`\`␊
`,
}
## md041-ignore-leading-comments-combined.md
> Snapshot 1