-
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
Automatically convert head[profile] to head > link[rel=profile] #4131
Comments
Discussing Implementation Brief Hi @westonruter, Assuming it's alright for me to work on this, what do you think about this plan:
diff --git a/src/Dom/Document.php b/src/Dom/Document.php
index 5bad55ddd..5979e983d 100644
--- a/src/Dom/Document.php
+++ b/src/Dom/Document.php
@@ -350,6 +350,8 @@ final class Document extends DOMDocument {
$this->head->removeChild( $meta );
}
+ $this->convert_head_profile_to_link();
+
// Add the required utf-8 meta charset tag.
$charset = $this->createElement( 'meta' );
$charset->setAttribute( 'charset', self::AMP_ENCODING ); Placing it in that location will mean that the new
Thanks, Weston! |
Yes, and make it
It can be appended to the
The value of the |
Thanks, Weston! That sounds good. |
Hi @westonruter, I'm not sure what functional testing is possible, other than a review from another developer. Thanks, Weston! |
Yeah. Moved to done. |
Thanks, Weston! |
Feature description
When doing an analysis of themes on WordPress, I got a
DISALLOWED_ATTR
validation error for theprofile
attribute on thehead
element, such as code in :The
profile
attribute on thehead
element is part of HTML4 but not HTML5.The W3 validator provides this advice:
According to this SO answer, the right way to represent this in HTML5 is:
This should perhaps be done as part of the normalization done in the
Document
class (appending thelink
element to the end of thehead
). It could also be done in a separate sanitizer, though that may be overkill. Since theDocument
class is normalizing to HTML5, I think it makes sense to let the class handle theprofile
transformation.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: