protected function tidy($html)
{
// Venn diagram join between XTHML + HTML5 Deprecated Attributes
//
// Our $spec is artisanally hand crafted based on squinting very hard while reading the following docs:
//
// + 2.3 - Extra HTML specifications using the $spec parameter
// + 3.4.6 - Transformation of deprecated attributes
// + 3.3.2 - Tag-transformation for better compliance with standards
// + HTML5 - Deprecated Tags & Attributes
//
// That is we do not remove deprecated attributes that are already transformed by htmLawed
//
// More info:
// + http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/beta/htmLawed_README.htm
// + http://www.tutorialspoint.com/html5/html5_deprecated_tags.htm
$config = array('valid_xhtml' => 1, 'no_deprecated_attr' => 2, 'unique_ids' => 'fixme-', 'hook' => '\\Pressbooks\\Sanitize\\html5_to_epub3', 'tidy' => -1, 'make_tag_strict' => 2, 'comment' => 1);
$spec = '';
$spec .= 'a=,-charset,-coords,-rev,-shape;';
$spec .= 'area=-nohref;';
$spec .= 'col=-align,-char,-charoff,-valign,-width;';
$spec .= 'colgroup=-align,-char,-charoff,-valign,-width;';
$spec .= 'div=-align;';
$spec .= 'iframe=-align,-frameborder,-longdesc,-marginheight,-marginwidth,-scrolling;';
$spec .= 'img=-longdesc;';
$spec .= 'link=-charset,-rev,-target;';
$spec .= 'menu=-compact;';
$spec .= 'object=-archive,-classid,-codebase,-codetype,-declare,-standby;';
$spec .= 'param=-type,-valuetype;';
$spec .= 't=-abbr,-axis;';
$spec .= 'table=-border,-cellpadding,-frame,-rules;';
$spec .= 'tbody=-align,-char,-charoff,-valign;';
$spec .= 'td=-axis,-abbr,-align,-char,-charoff,-scope,-valign;';
$spec .= 'tfoot=-align,-char,-charoff,-valign;';
$spec .= 'th=-align,-char,-charoff,-valign;';
$spec .= 'thead=-align,-char,-charoff,-valign;';
$spec .= 'tr=-align,-char,-charoff,-valign;';
$spec .= 'ul=-type;';
// Reset on each htmLawed invocation
unset($GLOBALS['hl_Ids']);
if (!empty($this->fixme)) {
$GLOBALS['hl_Ids'] = $this->fixme;
}
$html = htmLawed($html, $config, $spec);
return $html;
}