You are here

function html5_tools_process_html in HTML5 Tools 7

Implements hook_process_HOOK().

File

./html5_tools.module, line 212

Code

function html5_tools_process_html(&$variables) {

  // Remove cdata in inline css/js files.
  $cdata = array(
    "\n<!--//--><![CDATA[//><!--",
    "//--><!]]>\n",
  );
  $variables['scripts'] = str_replace($cdata, '', $variables['scripts']);
  $variables['page_bottom'] = str_replace($cdata, '', $variables['page_bottom']);
  $variables['styles'] = str_replace($cdata, '', $variables['styles']);
  $variables['rdf_header'] = '';
  $variables['rdf_profile'] = '';
  $variables['html_attributes'] = '';

  // Support RDF is it's enabled.
  if (module_exists('rdf')) {
    $variables['rdf_header'] = ' PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN"';
    $variables['rdf_profile'] = ' profile="' . $variables['grddl_profile'] . '"';
  }
  if (variable_get('html5_tools_add_chrome_frame_header', 1)) {
    drupal_add_http_header('X-UA-Compatible', 'IE=Edge,chrome=1');
  }

  // Add support for multiple extra html attributes.
  if (!empty($variables['html_attributes_array'])) {
    $variables['html_attributes'] = drupal_attributes($variables['html_attributes_array']);
  }
}