-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert head[profile]
attribute to link[rel=profile]
#4193
Conversation
Like Weston mentioned, that was invalid HTML5, so convert it to a link[rel=profile].
@todo: consider a case where there is both a |
For example, Twenty Twenty has a link[rel=profile], though it doesn't have a head[profile].
Using Weston's suggested code, handle this case.
Nice. I didn't notice that Twenty Twenty had this. Added validation that the normalization here is the right approach. |
…nt/4326-tiktok-embed * 'develop' of github.com:ampproject/amp-wp: Fix ZIP build after namespace rename Add missing namespace to common lib tests Fix phpcs issues in common and optimizer libs; include tests dir in cs/cbf scripts Fix and harden normalizeDomStructure when document lacks <html> Move any nodes appearing after </body> to be appended to the body Skip moving comments outside of html tags Merge changes from #4193 Merge changes into moved Dom\Document class Change root namespace for all three packages Deal with whitespace around comments Preserve comment positions (without breaking structure) Update src/Dom/Document.php Support content after html end tag
Summary
Like Weston mentioned,
head[profile]
is invalid, so this converts it to alink[rel=profile]
.To test this, I made this change in Twenty Twenty:
...and with this PR, the
head[profile]
is stripped and moved to a newhead > link[rel=profile]
:In the unlikely case that there's already a
head > link[rel=profile]
, this doesn't create a new one. It simply strips thehead[profile]
if it exists.Fixes #4131
Checklist