MD033/no-inline-html: Add table_allowed_elements parameter.

This commit is contained in:
Alexandre Feblot 2025-05-27 01:32:15 +02:00 committed by David Anson
parent c6e2ee1488
commit 1ac0b22804
16 changed files with 432 additions and 8 deletions

View file

@ -24422,6 +24422,22 @@ Generated by [AVA](https://avajs.dev).
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
13,
4,
],
fixInfo: null,
lineNumber: 60,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
],
fixed: `# inline_html-allowed_elements␊
@ -24479,6 +24495,11 @@ Generated by [AVA](https://avajs.dev).
<Br/> {MD033}␊
</P>
| Allowed | Not Allowed |␊
| ------- | ------------ |␊
| <h1> | |␊
| | <br> {MD033} |␊
<!-- markdownlint-configure-file {␊
"no-inline-html": {␊
"allowed_elements": [␊
@ -24492,6 +24513,262 @@ Generated by [AVA](https://avajs.dev).
`,
}
## inline_html-only_table_allowed_elements.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Element: h1',
errorRange: [
1,
4,
],
fixInfo: null,
lineNumber: 3,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
1,
4,
],
fixInfo: null,
lineNumber: 5,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
1,
5,
],
fixInfo: null,
lineNumber: 7,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: h1',
errorRange: [
25,
4,
],
fixInfo: null,
lineNumber: 14,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: table',
errorRange: [
1,
7,
],
fixInfo: null,
lineNumber: 16,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
3,
5,
],
fixInfo: null,
lineNumber: 17,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
],
fixed: `# inline_html-only_table_allowed_elements.md␊
<h1>This is not allowed {MD033}</h1>
<br> This is not allowed {MD033}␊
<br/> This is not allowed {MD033}␊
| Allowed | Not Allowed |␊
| ------------------- | ------------------ |␊
| <br> | |␊
| <br/> | |␊
| <table><br></table> | |␊
| | <h1> {MD033} </h1> |␊
<table> {MD033}␊
<br/> {MD033}␊
</table>
<!-- markdownlint-configure-file {␊
"no-inline-html": {␊
"table_allowed_elements": [␊
"br",␊
"tAbLE"␊
]␊
}␊
} -->␊
`,
}
## inline_html-table_allowed_elements.md
> Snapshot 1
{
errors: [
{
errorContext: null,
errorDetail: 'Element: h2',
errorRange: [
1,
4,
],
fixInfo: null,
lineNumber: 5,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
1,
4,
],
fixInfo: null,
lineNumber: 7,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
1,
5,
],
fixInfo: null,
lineNumber: 9,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: h1',
errorRange: [
25,
4,
],
fixInfo: null,
lineNumber: 16,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
{
errorContext: null,
errorDetail: 'Element: br',
errorRange: [
3,
5,
],
fixInfo: null,
lineNumber: 19,
ruleDescription: 'Inline HTML',
ruleInformation: 'https://github.com/DavidAnson/markdownlint/blob/v0.0.0/doc/md033.md',
ruleNames: [
'MD033',
'no-inline-html',
],
},
],
fixed: `# inline_html-table_allowed_elements.md␊
<h1>This is allowed</h1>
<h2>This is not allowed {MD033}</h2>
<br> This is not allowed {MD033}␊
<br/> This is not allowed {MD033}␊
| Allowed | Not Allowed |␊
| ------------------- | ------------------ |␊
| <br> | |␊
| <br/> | |␊
| <table><br></table> | |␊
| | <h1> {MD033} </h1> |␊
<table>
<br/> {MD033}␊
</table>
<!-- markdownlint-configure-file {␊
"no-inline-html": {␊
"allowed_elements": [␊
"h1",␊
"tAbLE"␊
],␊
"table_allowed_elements": [␊
"br",␊
"tAbLE"␊
]␊
}␊
} -->␊
`,
}
## inline_html.md
> Snapshot 1