Update MD031/blanks-around-fences to avoid duplicating list item markers when adding blank lines (fixes #485).

This commit is contained in:
David Anson 2022-05-14 19:18:13 -07:00
parent cf26cc7c92
commit 5f5f44e8e0
5 changed files with 576 additions and 4 deletions

View file

@ -2861,6 +2861,507 @@ Generated by [AVA](https://avajs.dev).
`,
}
## blanks-around-fences-in-lists.md
> Snapshot 1
{
errors: [
{
errorContext: '```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 6,
},
lineNumber: 5,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '2. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 6,
},
lineNumber: 6,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 9,
},
lineNumber: 8,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '3. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 9,
},
lineNumber: 9,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 18,
},
lineNumber: 17,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '- ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 18,
},
lineNumber: 18,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 21,
},
lineNumber: 20,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '- ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `␊
`,
lineNumber: 21,
},
lineNumber: 21,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 30,
},
lineNumber: 29,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> 2. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 30,
},
lineNumber: 30,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 33,
},
lineNumber: 32,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> 3. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 33,
},
lineNumber: 33,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 42,
},
lineNumber: 41,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> - ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 42,
},
lineNumber: 42,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 45,
},
lineNumber: 44,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> - ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `>␊
`,
lineNumber: 45,
},
lineNumber: 45,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 54,
},
lineNumber: 53,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > 2. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 54,
},
lineNumber: 54,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 57,
},
lineNumber: 56,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > 3. ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 57,
},
lineNumber: 57,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 66,
},
lineNumber: 65,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > - ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 66,
},
lineNumber: 66,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > ```',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 69,
},
lineNumber: 68,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
{
errorContext: '> > - ```text',
errorDetail: null,
errorRange: null,
fixInfo: {
insertText: `> >␊
`,
lineNumber: 69,
},
lineNumber: 69,
ruleDescription: 'Fenced code blocks should be surrounded by blank lines',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md031',
ruleNames: [
'MD031',
'blanks-around-fences',
],
},
],
fixed: `# Blanks Around Fences In Lists␊
1. \`\`\`text␊
Text␊
\`\`\`␊
2. \`\`\`text␊
Text␊
\`\`\`␊
3. \`\`\`text␊
Text␊
\`\`\`␊
Text␊
- \`\`\`text␊
Text␊
\`\`\`␊
- \`\`\`text␊
Text␊
\`\`\`␊
- \`\`\`text␊
Text␊
\`\`\`␊
Text␊
> 1. \`\`\`text␊
> Text␊
> \`\`\`␊
>␊
> 2. \`\`\`text␊
> Text␊
> \`\`\`␊
>␊
> 3. \`\`\`text␊
> Text␊
> \`\`\`␊
Text␊
> - \`\`\`text␊
> Text␊
> \`\`\`␊
>␊
> - \`\`\`text␊
> Text␊
> \`\`\`␊
>␊
> - \`\`\`text␊
> Text␊
> \`\`\`␊
Text␊
> > 1. \`\`\`text␊
> > Text␊
> > \`\`\`␊
> >␊
> > 2. \`\`\`text␊
> > Text␊
> > \`\`\`␊
> >␊
> > 3. \`\`\`text␊
> > Text␊
> > \`\`\`␊
Text␊
> > - \`\`\`text␊
> > Text␊
> > \`\`\`␊
> >␊
> > - \`\`\`text␊
> > Text␊
> > \`\`\`␊
> >␊
> > - \`\`\`text␊
> > Text␊
> > \`\`\`␊
`,
}
## blanks-around-headings-0-2.md
> Snapshot 1