From 2d62d1ca6f60c2b8609175732a31bf08883aca79 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Tue, 26 Apr 2022 13:17:01 +0200 Subject: [PATCH] Fix alignment issue with comment author name (#40610) * Remove duplicate font size class * Update unit tests Co-authored-by: Carlos Bravo --- .../block-library/src/comment-author-name/index.php | 5 +---- phpunit/class-block-library-comment-template-test.php | 10 +++++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/packages/block-library/src/comment-author-name/index.php b/packages/block-library/src/comment-author-name/index.php index 0bf3a475ba899..f15e041b74a8f 100644 --- a/packages/block-library/src/comment-author-name/index.php +++ b/packages/block-library/src/comment-author-name/index.php @@ -25,10 +25,7 @@ function render_block_core_comment_author_name( $attributes, $content, $block ) $classes = ''; if ( isset( $attributes['textAlign'] ) ) { - $classes .= 'has-text-align-' . esc_attr( $attributes['textAlign'] ); - } - if ( isset( $attributes['fontSize'] ) ) { - $classes .= 'has-' . esc_attr( $attributes['fontSize'] ) . '-font-size'; + $classes .= 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); diff --git a/phpunit/class-block-library-comment-template-test.php b/phpunit/class-block-library-comment-template-test.php index 8099ed1f08cf6..f03a392d2b3cc 100644 --- a/phpunit/class-block-library-comment-template-test.php +++ b/phpunit/class-block-library-comment-template-test.php @@ -138,7 +138,7 @@ function test_rendering_comment_template() { // Here we use the function prefixed with 'gutenberg_*' because it's added // in the build step. $this->assertEquals( - '
  1. Hello world
', + '
  1. Hello world
', gutenberg_render_block_core_comment_template( null, null, $block ) ); } @@ -194,7 +194,7 @@ function test_rendering_comment_template_nested() { <<
  • -
    +
    Test @@ -204,7 +204,7 @@ function test_rendering_comment_template_nested() {
    1. -
      +
      Test @@ -214,7 +214,7 @@ function test_rendering_comment_template_nested() {
      1. -
        +
        Test @@ -226,7 +226,7 @@ function test_rendering_comment_template_nested() {
    2. -