mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 05:50:13 +01:00
MD033/no-inline-html: Add table_allowed_elements parameter.
This commit is contained in:
parent
c6e2ee1488
commit
1ac0b22804
16 changed files with 432 additions and 8 deletions
|
|
@ -54,6 +54,11 @@ This is not allowed.
|
|||
<Br/> {MD033}
|
||||
</P>
|
||||
|
||||
| Allowed | Not Allowed |
|
||||
| ------- | ------------ |
|
||||
| <h1> | |
|
||||
| | <br> {MD033} |
|
||||
|
||||
<!-- markdownlint-configure-file {
|
||||
"no-inline-html": {
|
||||
"allowed_elements": [
|
||||
|
|
|
|||
27
test/inline_html-only_table_allowed_elements.md
Normal file
27
test/inline_html-only_table_allowed_elements.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# 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"
|
||||
]
|
||||
}
|
||||
} -->
|
||||
33
test/inline_html-table_allowed_elements.md
Normal file
33
test/inline_html-table_allowed_elements.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# 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"
|
||||
]
|
||||
}
|
||||
} -->
|
||||
|
|
@ -908,7 +908,7 @@ test("readme", async(t) => {
|
|||
});
|
||||
|
||||
test("validateJsonUsingConfigSchemaStrict", async(t) => {
|
||||
t.plan(201);
|
||||
t.plan(203);
|
||||
// @ts-ignore
|
||||
const ajv = new Ajv(ajvOptions);
|
||||
const validateSchemaStrict = ajv.compile(configSchemaStrict);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue