Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:ampproject/amp-wp into bump-gha-…
Browse files Browse the repository at this point in the history
…stable-php-version

* 'develop' of github.com:ampproject/amp-wp:
  Remove check for wp-dom-ready-js-translations which is no longer output in 6.0-alpha
  Account for variance in tests for CSS generated by postcss after #6980
  Bump postcss from 8.4.8 to 8.4.11
  Remove code that strip whitespace around equal signs from meta
  • Loading branch information
westonruter committed Mar 17, 2022
2 parents 648c5b7 + 6ae6fcb commit 5a7ee3e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
9 changes: 0 additions & 9 deletions includes/sanitizers/class-amp-meta-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,6 @@ public function sanitize() {
$meta_elements = iterator_to_array( $this->dom->getElementsByTagName( static::$tag ), false );

foreach ( $meta_elements as $meta_element ) {

// Strip whitespace around equal signs. Won't be needed after <https://github.com/ampproject/amphtml/issues/26496> is resolved.
if ( $meta_element->hasAttribute( Attribute::CONTENT ) ) {
$meta_element->setAttribute(
Attribute::CONTENT,
preg_replace( '/\s*=\s*/', '=', $meta_element->getAttribute( Attribute::CONTENT ) )
);
}

/**
* Meta tag to process.
*
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"lodash": "4.17.21",
"moment": "2.29.1",
"npm-run-all": "4.1.5",
"postcss": "8.4.8",
"postcss": "8.4.11",
"postcss-import": "14.0.2",
"postcss-loader": "4.3.0",
"postcss-nested": "5.0.1",
Expand Down
1 change: 1 addition & 0 deletions tests/php/test-amp-style-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3496,6 +3496,7 @@ function( $original_dom, $original_source, $amphtml_dom, $amphtml_source ) {

$this->assertStringContainsString( '.wp-block-audio figcaption', $amphtml_source, 'Expected block-library/style.css' );
$this->assertStringContainsString( '[class^="wp-block-"]:not(.wp-block-gallery) figcaption', $amphtml_source, 'Expected twentyten/blocks.css' );
$amphtml_source = preg_replace( '/\s*>\s*/', '>', $amphtml_source ); // Account for variance in postcss.
$this->assertStringContainsString( '.amp-wp-default-form-message>p', $amphtml_source, 'Expected amp-default.css' );
$this->assertStringContainsString( 'ab-empty-item', $amphtml_source, 'Expected admin-bar.css to still be present.' );
$this->assertStringNotContainsString( 'earlyprintstyle', $amphtml_source, 'Expected early print style to not be present.' );
Expand Down
3 changes: 1 addition & 2 deletions tests/php/validation/test-class-amp-validation-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1237,13 +1237,12 @@ static function () {
'//script[ @id = "jquery-core-js-before" ]',
'//script[ @id = "jquery-core-js-after" ]',
'//script[ @id = "wp-dom-ready-js" ]',
'//script[ @id = "wp-dom-ready-js-translations" ]',
'//script[ @id = "quicktags-js" ]',
'//script[ @id = "quicktags-js-extra" ]',
'//script[ contains( text(), "window.wpActiveEditor" ) ]',
],
function ( ...$sources_sets ) {
$this->assertCount( 7, $sources_sets );
$this->assertCount( 6, $sources_sets );
foreach ( $sources_sets as $sources ) {
$amp_source_count = 0;
foreach ( $sources as $source ) {
Expand Down

0 comments on commit 5a7ee3e

Please sign in to comment.