Skip to content

Characters for greater than and less than are not encoded as entities in attribute values #15636

@westonruter

Description

@westonruter

When adding > or < into an attribute value as follows:

<!-- wp:paragraph -->
<p><abbr title="1 &gt; 2">False</abbr> and <abbr title="1 &lt; 2">True</abbr></p>
<!-- /wp:paragraph -->

The serializer forces them to be > and < respectively.

<!-- wp:paragraph -->
<p><abbr title="1 > 2">False</abbr> and <abbr title="1 < 2">True</abbr></p>
<!-- /wp:paragraph -->

This gets rendered by WordPress as:

<p><abbr title="1 > 2&#8243;>False</abbr> and <abbr title="1 < 2">True</abbr></p>

The “False and” text is erroneously consumed be the attribute:

image

In this case, it seems to be a problem with wptexturize(), as it is converting the attribute closing " into &#8243;.

But if the block serializer output > as &gt; then this symptom could be avoided.

Possible regression after #9963.

Relates to #9915, #8779, #12683.

Tested in v5.7.0-rc.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] ParsingRelated to efforts to improving the parsing of a string of data and converting it into a different f[Feature] Rich TextRelated to the Rich Text component that allows developers to render a contenteditable[Feature] SavingRelated to saving functionality[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions