reverted: --- b/core/includes/theme.inc +++ a/core/includes/theme.inc @@ -16,7 +16,6 @@ use Drupal\Component\Utility\Xss; use Drupal\Core\Config\Config; use Drupal\Core\Config\StorageException; -use Drupal\Core\Render\SafeString; use Drupal\Core\Template\Attribute; use Drupal\Core\Theme\ThemeSettings; use Drupal\Component\Utility\NestedArray; @@ -1067,25 +1066,6 @@ } /** - * Prepares variables for inline list templates. - * - * Default template: inline-list.html.twig. - * - * @param array $variables - * An associative array containing: - * - items: An array of items to be displayed in the list. - * - separator: A string to separate list items. - * - empty: A message to display when there are no items. - * - * @see https://www.drupal.org/node/1842756 - */ -function template_preprocess_inline_list(&$variables) { - // Since the separator may be user-specified, it must be filtered to permit - // some HTML (such as
) to pass through. - $variables['separator'] = SafeString::create(Xss::filter($variables['separator'], ['br'])); -} - -/** * Returns HTML for an indentation div; used for drag and drop tables. * * @param $variables @@ -1746,9 +1726,6 @@ 'item_list' => array( 'variables' => array('items' => array(), 'title' => '', 'list_type' => 'ul', 'attributes' => array(), 'empty' => NULL, 'context' => array()), ), - 'inline_list' => array( - 'variables' => array('items' => array(), 'separator' => ', ', 'attributes' => array(), 'empty' => NULL), - ), 'feed_icon' => array( 'variables' => array('url' => NULL, 'title' => NULL), ), reverted: --- b/core/modules/system/src/Tests/Theme/FunctionsTest.php +++ a/core/modules/system/src/Tests/Theme/FunctionsTest.php @@ -168,50 +168,6 @@ } /** - * Tests inline-list.html.twig. - */ - function testInlineList() { - // Verify that empty items produce no output. - $variables = array(); - $expected = ''; - $this->assertThemeOutput('inline_list', $variables, $expected, 'Empty %callback generates no output.'); - - // Verify that empty items produce the empty string. - $variables = array(); - $variables['empty'] = 'No items found.'; - $expected = 'No items found.'; - $this->assertThemeOutput('inline_list', $variables, $expected, 'Empty %callback generates empty string.'); - - // Verify that empty text is not displayed when there are list items. - $variables = array(); - $variables['empty'] = 'No items found.'; - $variables['items'] = array('Rabbit', 'rabbit', 'rabbit'); - $expected = 'Rabbit, rabbit, rabbit'; - $this->assertThemeOutput('inline_list', $variables, $expected, '%callback does not print empty text when there are list items.'); - - // Verify that a non-default separator is rendered. - $variables = array(); - $variables['items'] = array('Un', 'Deux', 'Trois'); - $variables['separator'] = ' and '; - $expected = 'Un and Deux and Trois'; - $this->assertThemeOutput('inline_list', $variables, $expected, '%callback uses a custom separator when provided.'); - - // Verify that HTML separators are properly rendered. - $variables = array(); - $variables['items'] = array('Doe', 'Buck', 'Kit'); - $variables['separator'] = '
'; - $expected = 'Doe
Buck
Kit'; - $this->assertThemeOutput('inline_list', $variables, $expected, '%callback allows HTML in user-provided separators.'); - - // Verify that the separator is sanitized. - $variables = array(); - $variables['items'] = array('Un', 'Deux', 'Trois'); - $variables['separator'] = ''; - $expected = 'Unalert("test")Deuxalert("test")Trois'; - $this->assertThemeOutput('inline_list', $variables, $expected, '%callback sanitizes user-provided separators.'); - } - - /** * Tests links.html.twig. */ function testLinks() { reverted: --- b/core/modules/system/templates/inline-list.html.twig +++ /dev/null @@ -1,20 +0,0 @@ -{# -/** - * @file - * Default theme implementation for an inline list of items. - * - * Available variables: - * - items: A list of items. - * - separator: A delimiter to separate the items in the list. - * - empty: A message to display when there are no items. - * - * @see template_preprocess_inline_list() - * - * @ingroup themeable - */ -#} -{%- for item in items -%} - {{ item }}{{ loop.last ? '' : separator }} -{%- else -%} - {{- empty -}} -{%- endfor -%} diff -u b/core/modules/views_ui/src/ViewListBuilder.php b/core/modules/views_ui/src/ViewListBuilder.php --- b/core/modules/views_ui/src/ViewListBuilder.php +++ b/core/modules/views_ui/src/ViewListBuilder.php @@ -109,8 +109,9 @@ 'tag' => $view->get('tag'), 'path' => array( 'data' => array( - '#theme' => 'inline_list', + '#theme' => 'item_list', '#items' => $this->getDisplayPaths($view), + '#attributes' => array('class' => array('comma-list', 'inline')), ), ), 'operations' => $row['operations'], only in patch2: unchanged: --- a/core/modules/system/css/components/links.theme.css +++ b/core/modules/system/css/components/links.theme.css @@ -13,6 +13,12 @@ ul.inline li { list-style-type: none; padding: 0 0.5em; } +ul.comma-list li { + content: ", "; +} +ul.comma-list li:last-child:after { + content: ""; +} ul.links a.is-active { color: #000; }