Skip to content

<noscript/> in the body of XHTML5 should create an error #1170

@Booze-Operator

Description

@Booze-Operator

While the W3 validator reports an error:

Error: XHTML element [noscript](https://html.spec.whatwg.org/multipage/#the-noscript-element) not allowed as child of XHTML element [div](https://html.spec.whatwg.org/multipage/#the-div-element) in this context. (Suppressing further errors from this subtree.)

From line 256, column 19; to line 256, column 28

</script> <noscript>TEST</

Contexts in which element [noscript](https://html.spec.whatwg.org/multipage/#the-noscript-element) may be used:
    In a [head](https://html.spec.whatwg.org/multipage/#the-head-element) element of an [HTML document](https://dom.spec.whatwg.org/#html-document), if there are no ancestor [noscript](https://html.spec.whatwg.org/multipage/#the-noscript-element) elements.
    Where [phrasing content](https://html.spec.whatwg.org/multipage/#phrasing-content-2) is expected in [HTML documents](https://dom.spec.whatwg.org/#html-document), if there are no ancestor [noscript](https://html.spec.whatwg.org/multipage/#the-noscript-element) elements.

Issue: Tidy ignores <noscript/> in the body.

ATTN! To test this, you must ensure that the XHTML-page is served as **application/xhtml + xml**. You cannot upload a page nor enter XHTML code directly on the validator page, else the XML-parser is not invoked.

ATTN2! PSE note in the validator output the phrase

Where phrasing content is expected in [HTML documents]

It is HTML as opposed to XHTML.

Note also https://wiki.whatwg.org/wiki/HTML_vs._XHTML on the topic of noscript:

In HTML, if scripting is enabled, this element is parsed as an CDATA element. If scripting is disabled, it's parsed as a normal element. In XHTML, the element is always parsed as a normal element, and can't really be used to stop content from being present when script is disabled.

For the record and the next one who wants to do something about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions