Skip to content

[DOMParser] Spec behavior for noscript tags #1802

@xtuc

Description

@xtuc

You can find the spec for DOMParser here

The following example produce an incorrect output using JSDOM.

console.log(
    (new window.DOMParser())
        .parseFromString('<noscript><div>foo</div><img /></noscript>', 'text/html')
        .body
        .innerHTML
);

Chrome

<div>foo</div><img>

JSDom

Nothing.

If this is related to JSDom script configuration, I think (based on DOMParser spec) it should override the config.

I'm happy to help with a PR.

Edit:

In the HEAD:

console.log(
    (new window.DOMParser())
        .parseFromString('<noscript><div>foo</div><img /></noscript>', 'text/html')
        .head // <---
        .innerHTML
);

JSDom

<noscript><div>foo</div><img /></noscript>

Chrome

<noscript></noscript>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions