Skip to content

Commit

Permalink
feat(parser): Support search element (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
fb55 authored Mar 24, 2023
1 parent 880082e commit 9c14579
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/parse5/lib/common/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export enum TAG_NAMES {

S = 's',
SCRIPT = 'script',
SEARCH = 'search',
SECTION = 'section',
SELECT = 'select',
SOURCE = 'source',
Expand Down Expand Up @@ -292,6 +293,7 @@ export enum TAG_ID {

S,
SCRIPT,
SEARCH,
SECTION,
SELECT,
SOURCE,
Expand Down Expand Up @@ -423,6 +425,7 @@ const TAG_NAME_TO_ID = new Map<string, TAG_ID>([
[TAG_NAMES.RUBY, TAG_ID.RUBY],
[TAG_NAMES.S, TAG_ID.S],
[TAG_NAMES.SCRIPT, TAG_ID.SCRIPT],
[TAG_NAMES.SEARCH, TAG_ID.SEARCH],
[TAG_NAMES.SECTION, TAG_ID.SECTION],
[TAG_NAMES.SELECT, TAG_ID.SELECT],
[TAG_NAMES.SOURCE, TAG_ID.SOURCE],
Expand Down
1 change: 0 additions & 1 deletion packages/parse5/lib/parser/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ generateParsingTests(
{
withoutErrors: true,
suitePath: new URL('../../../../test/data/html5lib-tests/tree-construction', import.meta.url),
expectErrors: ['0.search-element', '1.search-element'],
},
(test, opts) => ({
node: test.fragmentContext ? parseFragment(test.fragmentContext, test.input, opts) : parse(test.input, opts),
Expand Down
2 changes: 2 additions & 0 deletions packages/parse5/lib/parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,7 @@ function startTagInBody<T extends TreeAdapterTypeMap>(p: Parser<T>, token: TagTo
case $.DETAILS:
case $.ADDRESS:
case $.ARTICLE:
case $.SEARCH:
case $.SECTION:
case $.SUMMARY:
case $.FIELDSET:
Expand Down Expand Up @@ -2583,6 +2584,7 @@ function endTagInBody<T extends TreeAdapterTypeMap>(p: Parser<T>, token: TagToke
case $.ADDRESS:
case $.ARTICLE:
case $.DETAILS:
case $.SEARCH:
case $.SECTION:
case $.SUMMARY:
case $.LISTING:
Expand Down

0 comments on commit 9c14579

Please sign in to comment.