Reimplement MD040/fenced-code-language using micromark tokens.

This commit is contained in:
David Anson 2024-02-18 17:22:32 -08:00
parent f5b5773b50
commit f26df4743c
5 changed files with 42 additions and 74 deletions

View file

@ -3,13 +3,13 @@
Fence code block information with leading whitespace:
``` html
<h1>markdownlint</h1> {MD040:5}
<h1>markdownlint</h1>
```
Fence code block information with trailing whitespace:
```css
body {} {MD040:11} {MD009:11}
body {} {MD009:11}
```
Fence code block information with extra data:

View file

@ -34755,7 +34755,7 @@ Generated by [AVA](https://avajs.dev).
],
},
{
errorContext: ' ```',
errorContext: '```',
errorDetail: null,
errorRange: null,
fixInfo: null,
@ -38128,33 +38128,7 @@ Generated by [AVA](https://avajs.dev).
},
{
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"',
errorDetail: 'Info string contains more than language: "```html version=5"',
errorRange: null,
fixInfo: null,
lineNumber: 17,
@ -38171,13 +38145,13 @@ Generated by [AVA](https://avajs.dev).
Fence code block information with leading whitespace:␊
\`\`\` html␊
<h1>markdownlint</h1> {MD040:5}
<h1>markdownlint</h1>
\`\`\`␊
Fence code block information with trailing whitespace:␊
\`\`\`css␊
body {} {MD040:11} {MD009:11}␊
body {} {MD009:11}␊
\`\`\`␊
Fence code block information with extra data:␊