Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const onlyValidChildren = {
'template',
]),
optgroup: new Set(['option']),
select: new Set(['optgroup', 'option', 'hr', 'button']),
select: new Set(['optgroup', 'option', 'hr', 'button', 'div']),
math: new Set(['mrow']),
script: new Set(),
// table
Expand All @@ -30,7 +30,7 @@ const onlyValidChildren = {
tfoot: new Set(['tr']),
// these elements can not have any children elements
iframe: emptySet,
option: emptySet,
option: new Set(['abbr', 'b', 'bdi', 'bdo', 'br', 'canvas', 'cite', 'code', 'data', 'del', 'dfn', 'div', 'em', 'i', 'img', 'ins', 'kbd', 'link', 'mark', 'meter', 'noscript', 'output', 'picture', 'progress', 'q', 'ruby', 's', 'samp', 'script', 'small', 'span', 'strong', 'sub', 'sup', 'template', 'time', 'u', 'var', 'wbr']),
textarea: emptySet,
style: emptySet,
title: emptySet,
Expand Down
1 change: 1 addition & 0 deletions tests/validation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ test('select', () => {
expect(isValidHTMLNesting('select', 'optgroup')).toBe(true);
expect(isValidHTMLNesting('select', 'hr')).toBe(true);
expect(isValidHTMLNesting('select', 'button')).toBe(true);
expect(isValidHTMLNesting('select', 'div')).toBe(true);
});

test('p', () => {
Expand Down