Add test scenario for rule violations after a multi-line code span.

This commit is contained in:
David Anson 2022-06-13 23:11:53 -07:00
parent 28b273e798
commit f284233f9a
3 changed files with 172 additions and 0 deletions

21
test/emphasis-markers.md Normal file
View file

@ -0,0 +1,21 @@
# Emphasis Markers
Text to _set_ the **preferences**.
This is *bad* {MD049}
This `is
also` *bad* {MD049}
This `is
also
very` *bad* {MD049}
This is __bad__ {MD050}
This `is
also` __bad__ {MD050}
This `is
also
very` __bad__ {MD050}

View file

@ -9010,6 +9010,157 @@ Generated by [AVA](https://avajs.dev).
`,
}
## emphasis-markers.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Expected: underscore; Actual: asterisk',
errorRange: [
9,
5,
],
fixInfo: {
deleteCount: 5,
editColumn: 9,
insertText: '_bad_',
},
lineNumber: 5,
ruleDescription: 'Emphasis style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md049',
ruleNames: [
'MD049',
'emphasis-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: underscore; Actual: asterisk',
errorRange: [
7,
5,
],
fixInfo: {
deleteCount: 5,
editColumn: 7,
insertText: '_bad_',
},
lineNumber: 8,
ruleDescription: 'Emphasis style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md049',
ruleNames: [
'MD049',
'emphasis-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: underscore; Actual: asterisk',
errorRange: [
7,
5,
],
fixInfo: {
deleteCount: 5,
editColumn: 7,
insertText: '_bad_',
},
lineNumber: 12,
ruleDescription: 'Emphasis style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md049',
ruleNames: [
'MD049',
'emphasis-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: asterisk; Actual: underscore',
errorRange: [
9,
7,
],
fixInfo: {
deleteCount: 7,
editColumn: 9,
insertText: '**bad**',
},
lineNumber: 14,
ruleDescription: 'Strong style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md050',
ruleNames: [
'MD050',
'strong-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: asterisk; Actual: underscore',
errorRange: [
7,
7,
],
fixInfo: {
deleteCount: 7,
editColumn: 7,
insertText: '**bad**',
},
lineNumber: 17,
ruleDescription: 'Strong style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md050',
ruleNames: [
'MD050',
'strong-style',
],
},
{
errorContext: null,
errorDetail: 'Expected: asterisk; Actual: underscore',
errorRange: [
7,
7,
],
fixInfo: {
deleteCount: 7,
editColumn: 7,
insertText: '**bad**',
},
lineNumber: 21,
ruleDescription: 'Strong style should be consistent',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/Rules.md#md050',
ruleNames: [
'MD050',
'strong-style',
],
},
],
fixed: `# Emphasis Markers␊
Text to _set_ the **preferences**.␊
This is _bad_ {MD049}␊
This \`is␊
also\` _bad_ {MD049}␊
This \`is␊
also␊
very\` _bad_ {MD049}␊
This is **bad** {MD050}␊
This \`is␊
also\` **bad** {MD050}␊
This \`is␊
also␊
very\` **bad** {MD050}␊
`,
}
## emphasis-not-heading-in-blockquote.md
> Snapshot 1