Skip to content

Meta viewport properties cause validation error when extra whitespace is present #26496

@westonruter

Description

@westonruter

During work on the AMP plugin for WordPress, @pierlon discovered that a meta viewport tag formatted with whitespace surrounding the equals signs resulted in a validation error (as seen in the Postmag theme for WordPress):

<meta name = "viewport" content = "width = device-width, initial-scale = 1.0" >

image

Nevertheless, both Chrome and Firefox seem to read the viewport properties just fine with the extra whitespace. So this appears to perhaps be a bug with how the AMP Validator parses the properties.

The quick fix for the AMP plugin is for the sanitizer to trim the extra whitespace. However, if the whitespace is valid in browsers then it seems the AMP Validator should also be fine with it.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions