You are here

function forena_clean_xhtml in Forena Reports 7

Same name and namespace in other branches
  1. 8 forena_ui/forena.admin.inc \forena_clean_xhtml()
  2. 6.2 forena.admin.inc \forena_clean_xhtml()
  3. 6 forena.admin.inc \forena_clean_xhtml()
  4. 7.5 forena.admin.inc \forena_clean_xhtml()
  5. 7.2 forena.admin.inc \forena_clean_xhtml()
  6. 7.3 forena.admin.inc \forena_clean_xhtml()
  7. 7.4 forena.admin.inc \forena_clean_xhtml()

Clean xhtml

Parameters

unknown_type $xhtml:

Return value

unknown

1 call to forena_clean_xhtml()
forena_data_block_add in ./forena.admin.inc
submit handler for forena_data_block_form. This adds the datablock to an existing report.

File

./forena.admin.inc, line 1200

Code

function forena_clean_xhtml($xhtml) {
  $ret = $xhtml;

  // If tidy is installed lets clean the html using that.
  if (is_callable('tidy_repair_string')) {
    $config = array(
      'doctype' => 'omit',
      'indent-spaces' => 2,
      'indent' => 'auto',
      'input-xml' => TRUE,
      'output-xml' => TRUE,
      'indent-attributes' => FALSE,
      'indent-spaces' => 2,
      'add-xml-space' => TRUE,
      'wrap' => 135,
    );
    $ret = tidy_repair_string($xhtml, $config, 'utf8');
  }
  else {
    $ret = str_replace(' ', ' ', $ret);
  }
  return $ret;
}