mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Update MD005, MD007, MD022, MD037, MD038 to not report violations within "htmlFlow" context (fixes #999).
This commit is contained in:
parent
2a56f130c1
commit
63325edc97
15 changed files with 511 additions and 149 deletions
|
|
@ -19,9 +19,9 @@
|
|||
*comment *
|
||||
*comment * -->
|
||||
|
||||
<!--> *{MD037} * -->
|
||||
<!--> *text * -->
|
||||
|
||||
<!---> *{MD037} * -->
|
||||
<!---> *text * -->
|
||||
|
||||
<!-- *comment * --->
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ hard tab / space *in * emphasis / space `in ` code <!-- markdownlint-disable-lin
|
|||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space `in ` code
|
||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||
<!-- markdownlint-disable-line MD010 MD038 --> hard tab / space *in * emphasis {MD037} / space `in ` code
|
||||
<!-- markdownlint-disable-line MD010 --> hard tab / space *in * emphasis / space `in ` code
|
||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||
hard tab / space *in * emphasis {MD037} / space `in ` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->
|
||||
hard tab {MD010} / space *in * emphasis {MD037} / space `in ` code {MD038}
|
||||
|
|
|
|||
37
test/markdown-in-html.md
Normal file
37
test/markdown-in-html.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# Markdown in HTML
|
||||
|
||||
Text
|
||||
|
||||
+ Item
|
||||
|
||||
Text
|
||||
|
||||
<p>
|
||||
## Heading 2a
|
||||
- Text *text* text * text * text ** text ** text `text` text ` text ` text
|
||||
- Text https://example.com/ [ link ](https://example.com/)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
### Heading 3a ###
|
||||
Text
|
||||
</p>
|
||||
|
||||
Text
|
||||
|
||||
<p>
|
||||
|
||||
## Heading 2b {MD019} {MD022}
|
||||
- Text *text* text * text * text ** text ** text `text` text ` text ` text {MD004} {MD007} {MD032} {MD037} {MD038}
|
||||
- Text https://example.com/ [ link ](https://example.com/) {MD004} {MD005} {MD039}
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
### Heading 3b {MD003} {MD021} {MD022} ###
|
||||
Text
|
||||
|
||||
</p>
|
||||
|
||||
<!-- markdownlint-disable-file MD013 MD033 -->
|
||||
|
|
@ -42,11 +42,7 @@ Generated by [AVA](https://avajs.dev).
|
|||
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 60: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||
test-repos/mdn-content/files/en-us/web/css/angle/index.md: 71: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 67: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 251: MD045/no-alt-text Images should have alternate text (alt text)␊
|
||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 234: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 10]␊
|
||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 556: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]␊
|
||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 769: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]␊
|
||||
test-repos/mdn-content/files/en-us/web/svg/attribute/d/index.md: 838: MD007/ul-indent Unordered list indentation [Expected: 0; Actual: 12]`
|
||||
test-repos/mdn-content/files/en-us/web/css/transform-function/rotate3d/index.md: 251: MD045/no-alt-text Images should have alternate text (alt text)`
|
||||
|
||||
## https://github.com/mkdocs/mkdocs
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -18250,44 +18250,6 @@ Generated by [AVA](https://avajs.dev).
|
|||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: '} *',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
14,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 15,
|
||||
},
|
||||
lineNumber: 22,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '} *',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
15,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 16,
|
||||
},
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '} *',
|
||||
errorDetail: null,
|
||||
|
|
@ -18348,9 +18310,9 @@ Generated by [AVA](https://avajs.dev).
|
|||
*comment *␊
|
||||
*comment * -->␊
|
||||
␊
|
||||
<!--> *{MD037}* -->␊
|
||||
<!--> *text * -->␊
|
||||
␊
|
||||
<!---> *{MD037}* -->␊
|
||||
<!---> *text * -->␊
|
||||
␊
|
||||
<!-- *comment * --->␊
|
||||
␊
|
||||
|
|
@ -22064,25 +22026,6 @@ Generated by [AVA](https://avajs.dev).
|
|||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: 'n *',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
67,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 68,
|
||||
},
|
||||
lineNumber: 98,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: 'n *',
|
||||
errorDetail: null,
|
||||
|
|
@ -22835,7 +22778,7 @@ Generated by [AVA](https://avajs.dev).
|
|||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||
<!-- markdownlint-disable-line -->hard tab / space *in * emphasis / space \`in \` code␊
|
||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||
<!-- markdownlint-disable-line MD010 MD038 --> hard tab / space *in* emphasis {MD037} / space \`in \` code␊
|
||||
<!-- markdownlint-disable-line MD010 --> hard tab / space *in * emphasis / space \`in \` code␊
|
||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||
hard tab / space *in* emphasis {MD037} / space \`in \` code <!-- markdownlint-disable-line MD010 --><!-- markdownlint-disable-line MD038 -->␊
|
||||
hard tab {MD010} / space *in* emphasis {MD037} / space \`in\` code {MD038}␊
|
||||
|
|
@ -33077,6 +33020,352 @@ Generated by [AVA](https://avajs.dev).
|
|||
`,
|
||||
}
|
||||
|
||||
## markdown-in-html.md
|
||||
|
||||
> Snapshot 1
|
||||
|
||||
{
|
||||
errors: [
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: atx; Actual: atx_closed',
|
||||
errorRange: null,
|
||||
fixInfo: null,
|
||||
lineNumber: 32,
|
||||
ruleDescription: 'Heading style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md003.md',
|
||||
ruleNames: [
|
||||
'MD003',
|
||||
'heading-style',
|
||||
'header-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: plus; Actual: dash',
|
||||
errorRange: [
|
||||
1,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 2,
|
||||
insertText: '+',
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Unordered list style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
|
||||
ruleNames: [
|
||||
'MD004',
|
||||
'ul-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: plus; Actual: dash',
|
||||
errorRange: [
|
||||
1,
|
||||
2,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 1,
|
||||
insertText: '+',
|
||||
},
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Unordered list style',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md004.md',
|
||||
ruleNames: [
|
||||
'MD004',
|
||||
'ul-style',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 1; Actual: 0',
|
||||
errorRange: [
|
||||
1,
|
||||
2,
|
||||
],
|
||||
fixInfo: null,
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Inconsistent indentation for list items at the same level',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md005.md',
|
||||
ruleNames: [
|
||||
'MD005',
|
||||
'list-indent',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: null,
|
||||
errorDetail: 'Expected: 0; Actual: 1',
|
||||
errorRange: [
|
||||
1,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 1,
|
||||
insertText: '',
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Unordered list indentation',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md007.md',
|
||||
ruleNames: [
|
||||
'MD007',
|
||||
'ul-indent',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Heading 2b {MD019} {MD022}',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
1,
|
||||
5,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 3,
|
||||
},
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Multiple spaces after hash on atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md019.md',
|
||||
ruleNames: [
|
||||
'MD019',
|
||||
'no-multiple-space-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '### Heading 3b...1} {MD022} ###',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
1,
|
||||
6,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 44,
|
||||
editColumn: 1,
|
||||
insertText: '### Heading 3b {MD003} {MD021} {MD022} ###',
|
||||
},
|
||||
lineNumber: 32,
|
||||
ruleDescription: 'Multiple spaces inside hashes on closed atx style heading',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md021.md',
|
||||
ruleNames: [
|
||||
'MD021',
|
||||
'no-multiple-space-closed-atx',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '## Heading 2b {MD019} {MD022}',
|
||||
errorDetail: 'Expected: 1; Actual: 0; Below',
|
||||
errorRange: null,
|
||||
fixInfo: {
|
||||
insertText: `␊
|
||||
`,
|
||||
lineNumber: 25,
|
||||
},
|
||||
lineNumber: 24,
|
||||
ruleDescription: 'Headings should be surrounded by blank lines',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md',
|
||||
ruleNames: [
|
||||
'MD022',
|
||||
'blanks-around-headings',
|
||||
'blanks-around-headers',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '### Heading 3b {MD003} {MD021} {MD022} ###',
|
||||
errorDetail: 'Expected: 1; Actual: 0; Below',
|
||||
errorRange: null,
|
||||
fixInfo: {
|
||||
insertText: `␊
|
||||
`,
|
||||
lineNumber: 33,
|
||||
},
|
||||
lineNumber: 32,
|
||||
ruleDescription: 'Headings should be surrounded by blank lines',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md022.md',
|
||||
ruleNames: [
|
||||
'MD022',
|
||||
'blanks-around-headings',
|
||||
'blanks-around-headers',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '- Text *text* text * text * te...',
|
||||
errorDetail: null,
|
||||
errorRange: null,
|
||||
fixInfo: {
|
||||
insertText: `␊
|
||||
`,
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Lists should be surrounded by blank lines',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md032.md',
|
||||
ruleNames: [
|
||||
'MD032',
|
||||
'blanks-around-lists',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '* t',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
21,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 22,
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: 't *',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
26,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 27,
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '** t',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
35,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 37,
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: 't **',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
41,
|
||||
4,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 42,
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '` text `',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
63,
|
||||
10,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 8,
|
||||
editColumn: 64,
|
||||
insertText: 'text',
|
||||
},
|
||||
lineNumber: 25,
|
||||
ruleDescription: 'Spaces inside code span elements',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md038.md',
|
||||
ruleNames: [
|
||||
'MD038',
|
||||
'no-space-in-code',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '[ link ]',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
29,
|
||||
8,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 6,
|
||||
editColumn: 30,
|
||||
insertText: 'link',
|
||||
},
|
||||
lineNumber: 26,
|
||||
ruleDescription: 'Spaces inside link text',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md039.md',
|
||||
ruleNames: [
|
||||
'MD039',
|
||||
'no-space-in-links',
|
||||
],
|
||||
},
|
||||
],
|
||||
fixed: `# Markdown in HTML␊
|
||||
␊
|
||||
Text␊
|
||||
␊
|
||||
+ Item␊
|
||||
␊
|
||||
Text␊
|
||||
␊
|
||||
<p>␊
|
||||
## Heading 2a␊
|
||||
- Text *text* text * text * text ** text ** text \`text\` text \` text \` text␊
|
||||
- Text https://example.com/ [ link ](https://example.com/)␊
|
||||
</p>␊
|
||||
␊
|
||||
<p>␊
|
||||
### Heading 3a ###␊
|
||||
Text␊
|
||||
</p>␊
|
||||
␊
|
||||
Text␊
|
||||
␊
|
||||
<p>␊
|
||||
␊
|
||||
## Heading 2b {MD019} {MD022}␊
|
||||
␊
|
||||
+ Text *text* text *text* text **text** text \`text\` text \`text\` text {MD004} {MD007} {MD032} {MD037} {MD038}␊
|
||||
+ Text https://example.com/ [link](https://example.com/) {MD004} {MD005} {MD039}␊
|
||||
␊
|
||||
</p>␊
|
||||
␊
|
||||
<p>␊
|
||||
␊
|
||||
### Heading 3b {MD003} {MD021} {MD022} ###␊
|
||||
␊
|
||||
Text␊
|
||||
␊
|
||||
</p>␊
|
||||
␊
|
||||
<!-- markdownlint-disable-file MD013 MD033 -->␊
|
||||
`,
|
||||
}
|
||||
|
||||
## mathjax-scenarios.md
|
||||
|
||||
> Snapshot 1
|
||||
|
|
@ -45551,44 +45840,6 @@ Generated by [AVA](https://avajs.dev).
|
|||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '* H',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
17,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 18,
|
||||
},
|
||||
lineNumber: 383,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: 'L *',
|
||||
errorDetail: null,
|
||||
errorRange: [
|
||||
22,
|
||||
3,
|
||||
],
|
||||
fixInfo: {
|
||||
deleteCount: 1,
|
||||
editColumn: 23,
|
||||
},
|
||||
lineNumber: 383,
|
||||
ruleDescription: 'Spaces inside emphasis markers',
|
||||
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md037.md',
|
||||
ruleNames: [
|
||||
'MD037',
|
||||
'no-space-in-emphasis',
|
||||
],
|
||||
},
|
||||
{
|
||||
errorContext: '* H',
|
||||
errorDetail: null,
|
||||
|
|
@ -46010,7 +46261,7 @@ Generated by [AVA](https://avajs.dev).
|
|||
Emphasis <b>inside *HTML* content</b> {MD033} {MD037}␊
|
||||
␊
|
||||
<p> {MD033}␊
|
||||
Emphasis inside *HTML* content {MD037}␊
|
||||
Emphasis inside * HTML * content␊
|
||||
</p>␊
|
||||
␊
|
||||
Emphasis <p data="inside * attribute * content"></p> {MD033}␊
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -380,7 +380,7 @@ Partial *em*phasis of a *wo*rd.
|
|||
Emphasis <b>inside * HTML * content</b> {MD033} {MD037}
|
||||
|
||||
<p> {MD033}
|
||||
Emphasis inside * HTML * content {MD037}
|
||||
Emphasis inside * HTML * content
|
||||
</p>
|
||||
|
||||
Emphasis <p data="inside * attribute * content"></p> {MD033}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue