diff --git a/includes/common.inc b/includes/common.inc index 6b0ef44f2f..0f7c014b5f 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -5772,10 +5772,11 @@ function drupal_pre_render_conditional_comments($elements) { /** * TODO */ -function drupal_pre_render_htmltag_markup(array $elements) { +function drupal_pre_render_htmltag(array $elements) { $void_elements = array( - 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'keygen', - 'link', 'meta', 'param', 'source', 'track', 'wbr', + 'area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', + 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr', + 'rect', 'circle', 'polygon', 'ellipse', 'stop', 'use', 'path', ); $attributes = isset($elements['#attributes']) ? drupal_attributes($elements['#attributes']) : ''; @@ -5793,9 +5794,14 @@ function drupal_pre_render_htmltag_markup(array $elements) { $elements['#markup'] = $elements['#value']; } + $open_tag .= $elements['#value_prefix']; + $close_tag = $elements['#value_suffix'] . $close_tag; + $elements['#prefix'] .= $open_tag; $elements['#suffix'] = $close_tag . $elements['#suffix'] ."\n"; + $elements['#children'] = $elements['#markup']; + return $elements; } diff --git a/includes/theme.inc b/includes/theme.inc index 97f1b8df6b..28a9e2bcdb 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -2313,11 +2313,19 @@ function theme_feed_icon($variables) { * wrapper prefix. * - #value_suffix: (optional) A string to append to #value, e.g. a CDATA * wrapper suffix. + * + * @return array + * The render array. + * + * @deprecated + * This theme hook was removed in Drupal 8. +// Use '#type' => 'html_tag' instead of '#theme' => 'html_tag'. */ function theme_html_tag($variables) { - $element = $variables['element']; + // Ensure the type is always "html_tag" and then render the element. + $variables['element']['#type'] = 'html_tag'; - return $element['#markup']; + return drupal_render($variables['element']); } /** diff --git a/modules/system/system.module b/modules/system/system.module index 762d56a870..a0da501fb8 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -312,15 +312,16 @@ function system_element_info() { '#error' => NULL, ); $types['html_tag'] = array( - '#theme' => 'html_tag', + '#attributes' => array(), '#pre_render' => array( 'drupal_pre_render_conditional_comments', - 'drupal_pre_render_htmltag_markup', + 'drupal_pre_render_htmltag', ), - '#attributes' => array(), - '#value' => NULL, '#prefix' => NULL, '#suffix' => NULL, + '#value' => NULL, + '#value_prefix' => NULL, + '#value_suffix' => NULL, ); $types['styles'] = array( '#items' => array(),