Skip to content

AMP should respect ⚡️ apart from ⚡ #25990

@tomayac

Description

@tomayac

Both ⚡️ and ⚡ look the same, but they're different:

'⚡️'.length;
// 2
'⚡'.length;
// 1
'⚡'.charCodeAt(0) + ' ' + '⚡'.charCodeAt(1);
// "9889 NaN"
'⚡️'.charCodeAt(0) + ' ' + '⚡️'.charCodeAt(1);
// "9889 65039"

AMP respects the ⚡but rejects ⚡️, which is confusing since the macOS emoji picker creates ⚡️, that is, the representation with the Unicode Variation Selector-16.

amp-validator

The AMP validator checks for the presence of the representation without Variation Selector-16, but then replaces it with amp, the same happens on the AMP cache.

To avoid this confusion, AMP could potentially allow for both, ⚡️ and ⚡, and then just replace them with the textual attribute amp.

More background on this bug: https://blog.tomayac.com/2019/12/12/same-same-but-different-unicode-variation-selector-16/.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions