Skip to content

Improve the note on characters that need to be escaped in iframes' srcdoc #1429

@prlbr

Description

@prlbr

A note in https://html.spec.whatwg.org/multipage/embedded-content.html#attr-iframe-srcdoc reads

In the HTML syntax, authors need only remember to use U+0022 QUOTATION MARK characters (") to wrap the attribute contents and then to escape all U+0022 QUOTATION MARK (") and U+0026 AMPERSAND (&) characters, and to specify the sandbox attribute, to ensure safe embedding of content.

It's important to escape the ampersands first and the quotation marks second, so that ", when used to delimit attribute values, will be changed to e.g. " and not ". Can the note be made clearer in this respect?

I'd at least change the order in which the characters are named from

U+0022 QUOTATION MARK (") and U+0026 AMPERSAND (&)

to

U+0026 AMPERSAND (&) and U+0022 QUOTATION MARK (")

Metadata

Metadata

Assignees

No one assigned

    Labels

    clarificationStandard could be clearergood first issueIdeal for someone new to a WHATWG standard or software project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions