Skip to content

Commit 6ed8ed5

Browse files
authored
Merge pull request #9 from MananTank/p-input-nesting
Make p > input nesting valid
2 parents 966e63a + 1eef8a1 commit 6ed8ed5

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "validate-html-nesting",
3-
"version": "1.2.0",
3+
"version": "1.2.2",
44
"description": "Validate parent-child nesting for HTML elements",
55
"main": "src/index.js",
66
"types": "./src/types.d.ts",

src/mapping.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ const knownInvalidChildren = {
8787
'h6',
8888
'header',
8989
'hgroup',
90-
'input',
9190
'hr',
9291
'li',
9392
'main',

tests/validation.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ test('p', () => {
1818
expect(isValidHTMLNesting('p', 'p')).toBe(false);
1919
expect(isValidHTMLNesting('p', 'div')).toBe(false);
2020
expect(isValidHTMLNesting('p', 'hr')).toBe(false);
21-
expect(isValidHTMLNesting('p', 'input')).toBe(false);
2221
expect(isValidHTMLNesting('p', 'blockquote')).toBe(false);
2322
expect(isValidHTMLNesting('p', 'pre')).toBe(false);
2423

@@ -29,6 +28,8 @@ test('p', () => {
2928
expect(isValidHTMLNesting('p', 'button')).toBe(true);
3029
expect(isValidHTMLNesting('p', 'b')).toBe(true);
3130
expect(isValidHTMLNesting('p', 'i')).toBe(true);
31+
expect(isValidHTMLNesting('p', 'input')).toBe(true);
32+
expect(isValidHTMLNesting('p', 'label')).toBe(true);
3233
});
3334

3435
test('a', () => {

0 commit comments

Comments
 (0)