Include embedded `<head>` scripts when applying templates.

Description

Guise Mummy, when applying templates, already merges in <head> links such as external scripts, but doesn't currently import embedded inline script content in the source file, e.g.:

Improve template application to include inline scripts.

The HTML 5.2 specification describes the <script> element.

Environment

None

Activity

Show:
Garret Wilson
March 21, 2020, 8:08 PM

See also Douglas Crockford's JavaScript and HTML Script Tags. In short:

Garret Wilson
March 21, 2020, 7:55 PM
Edited

From the WHATWG guidance for element-specific parsing, it seems that the easiest way to encode JavaScript in XHTML and have it generated in HTML with no further Guise Mummy modifications is to use:

Garret Wilson
March 21, 2020, 6:40 PM

The Stack Overflow questions Using HTML comment tag <!ā€” --> still relevant around JavaScript code? and Should I use CDATA in HTML5? discuss the best ways to structure an inline script to work with XHTML and HTML. The definitive recommendation may be the WHATWG guidance for element-specific parsing.

Fixed

Assignee

Garret Wilson

Reporter

Garret Wilson

Labels

None

Components

Fix versions

Affects versions

Priority

Critical