reverted: --- b/core/lib/Drupal/Component/Utility/Html.php +++ a/core/lib/Drupal/Component/Utility/Html.php @@ -393,19 +393,4 @@ return htmlspecialchars($text, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } - /** - * Decodes HTML entities back to characters. - * - * This method is the opposite of Html::escape(). - * - * @param $text - * The input text. - * - * @return string - * The text with all HTML entities decoded back to characters. - */ - public static function unescape($text) { - return htmlspecialchars_decode($text, ENT_QUOTES | ENT_SUBSTITUTE); - } - } diff -u b/core/modules/views/src/Tests/FieldApiDataTest.php b/core/modules/views/src/Tests/FieldApiDataTest.php --- b/core/modules/views/src/Tests/FieldApiDataTest.php +++ b/core/modules/views/src/Tests/FieldApiDataTest.php @@ -99,7 +99,8 @@ // Click sort should only be on the primary field. $this->assertTrue(empty($data[$revision_table][$field_storage->getName()]['field']['click sortable']), 'Non-primary fields are not click sortable'); - $this->assertEqual($data[$current_table][$field_storage->getName()]['help'], 'Appears in: page, article. Also known as: Content: The giraffe2" label'); + $help = \Drupal::service('renderer')->renderPlain($data[$current_table][$field_storage->getName()]['help']); + $this->assertEqual(1, preg_match('/Appears in: .*page.*article.*\. Also known as: .*Content: The giraffe2" label.*\./', $help), 'Help text has the expected format'); } } diff -u b/core/modules/views/views.views.inc b/core/modules/views/views.views.inc --- b/core/modules/views/views.views.inc +++ b/core/modules/views/views.views.inc @@ -322,9 +322,6 @@ } } - /** @var \Drupal\Core\Render\RendererInterface $renderer */ - $renderer = \Drupal::service('renderer'); - // Description of the field tables. // @todo Generalize this code to make it work with any table layout. See // https://www.drupal.org/node/2079019. @@ -422,7 +419,17 @@ 'group' => $group, 'title' => $label, 'title short' => $label, - 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))), + 'help' => [ + [ + '#markup' => t('Appears in:'), + '#suffix' => ' ', + ], + [ + '#theme' => 'item_list', + '#items' => $bundles_names, + '#context' => ['list_style' => 'comma-list'], + ] + ], ); // Go through and create a list of aliases for all possible combinations of @@ -453,8 +460,18 @@ } if ($aliases) { $data[$table_alias][$field_alias]['aliases'] = $aliases; - // Decode the entities, as they might have been escaped before. - $data[$table_alias][$field_alias]['help'] .= ' ' . t('Also known as: ') . Html::unescape(implode(', ', $also_known)); + $data[$table_alias][$field_alias]['help'][] = [ + '#prefix' => '. ', + '#markup' => t('Also known as:'), + '#suffix' => ' ', + ]; + $data[$table_alias][$field_alias]['help'][] = [ + '#theme' => 'item_list', + '#items' => $also_known, + '#context' => ['list_style' => 'comma-list'], + '#suffix' => '.', + ]; + } $keys = array_keys($field_columns); @@ -530,7 +547,17 @@ 'group' => $group, 'title' => $title, 'title short' => $title_short, - 'help' => t('Appears in: @bundles.', array('@bundles' => implode(', ', $bundles_names))), + 'help' => [ + [ + '#markup' => t('Appears in:'), + '#suffix' => ' ', + ], + [ + '#theme' => 'item_list', + '#context' => ['list_style' => 'comma-list'], + '#items' => $bundles_names, + ] + ], ); // Go through and create a list of aliases for all possible combinations of @@ -555,10 +582,17 @@ } if ($aliases) { $data[$table_alias][$column_real_name]['aliases'] = $aliases; - // Decode the entities, as they might have been escaped before. - $data[$table_alias][$column_real_name]['help'] .= ' ' . t('Also known as: ') . Html::unescape(implode(', ', $also_known)); + $data[$table_alias][$column_real_name]['help'][] = [ + '#prefix' => ' ', + '#markup' => t('Also known as:'), + '#suffix' => ' ', + ]; + $data[$table_alias][$column_real_name]['help'][] = [ + '#theme' => 'item_list', + '#items' => $also_known, + '#context' => ['list_style' => 'comma-list'], + ]; } - $data[$table_alias][$column_real_name]['argument'] = array( 'field' => $column_real_name, 'table' => $table, diff -u b/core/modules/views_ui/src/ViewEditForm.php b/core/modules/views_ui/src/ViewEditForm.php --- b/core/modules/views_ui/src/ViewEditForm.php +++ b/core/modules/views_ui/src/ViewEditForm.php @@ -139,14 +139,14 @@ '#account' => $this->entityManager->getStorage('user')->load($view->lock->owner), ); $lock_message_substitutions = array( - '@user' => drupal_render($username), - '@age' => $this->dateFormatter->formatTimeDiffSince($view->lock->updated), + '!user' => drupal_render($username), + '!age' => $this->dateFormatter->formatTimeDiffSince($view->lock->updated), '@url' => $view->url('break-lock-form'), ); $form['locked'] = array( '#type' => 'container', '#attributes' => array('class' => array('view-locked', 'messages', 'messages--warning')), - '#children' => $this->t('This view is being edited by user @user, and is therefore locked from editing by others. This lock is @age old. Click here to break this lock.', $lock_message_substitutions), + '#children' => $this->t('This view is being edited by user !user, and is therefore locked from editing by others. This lock is !age old. Click here to break this lock.', $lock_message_substitutions), '#weight' => -10, ); } reverted: --- b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php +++ a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php @@ -310,47 +310,4 @@ $this->assertSame('<em>répété</em>', $escaped); } - /** - * Tests Html::unescape(). - * - * @dataProvider providerUnescape - * @covers ::unescape - */ - public function testUnescape($expected, $text) { - $this->assertEquals($expected, Html::unescape($text)); - } - - /** - * Data provider for testUnescape(). - * - * @see testUnescape() - */ - public function providerUnescape() { - return [ - ['Drupal', 'Drupal'], - ['