diff -u b/core/modules/filter/src/Plugin/Filter/FilterHtml.php b/core/modules/filter/src/Plugin/Filter/FilterHtml.php --- b/core/modules/filter/src/Plugin/Filter/FilterHtml.php +++ b/core/modules/filter/src/Plugin/Filter/FilterHtml.php @@ -82,19 +82,23 @@ /** * Get inline template to avoid Twig autoescape - * See https://www.drupal.org/node/2311123 + * * @param string $content + * A string with the content for the template. + * * @param boolean $is_html_code - * @return string + * A boolean indicating whether the content should be rendered or + * be included inside tag. + * + * @return + * A inline_template render array. */ - private function getInlineTemplate($content, $is_html_code) { + protected function getInlineTemplate($content, $is_html_code) { return array( - 'string' => array( - '#type' => 'inline_template', - '#template' => $is_html_code ? '{{content}}' : $content, - '#context' => array( - 'content' => $content, - ), + '#type' => 'inline_template', + '#template' => $is_html_code ? '{{content}}' : $content, + '#context' => array( + 'content' => $content, ), ); } @@ -163,8 +167,8 @@ if (!empty($tips[$tag])) { $rows[] = array( array('data' => $tips[$tag][0], 'class' => array('description')), - array('data' => drupal_render($this->getInlineTemplate($tips[$tag][1], TRUE)), 'class' => array('type')), - array('data' => drupal_render($this->getInlineTemplate($tips[$tag][1], FALSE)), 'class' => array('get')) + array('data' => $this->getInlineTemplate($tips[$tag][1], TRUE), 'class' => array('type')), + array('data' => $this->getInlineTemplate($tips[$tag][1], FALSE), 'class' => array('get')) ); } else { @@ -194,8 +198,8 @@ foreach ($entities as $entity) { $rows[] = array( array('data' => $entity[0], 'class' => array('description')), - array('data' => drupal_render($this->getInlineTemplate($entity[1], TRUE)), 'class' => array('type')), - array('data' => drupal_render($this->getInlineTemplate($entity[1], FALSE)), 'class' => array('get')) + array('data' => $this->getInlineTemplate($entity[1], TRUE), 'class' => array('type')), + array('data' => $this->getInlineTemplate($entity[1], FALSE), 'class' => array('get')) ); } $table = array(