private static function html5Config(\HTMLPurifier_Config $config) { $config->set('HTML.DefinitionID', 'jivoo.html5'); $config->set('HTML.DefinitionRev', 1); $def = $config->maybeGetRawHTMLDefinition(); if ($def) { $def->addElement('figure', 'Block', 'Optional: (figcaption, Flow) | (Flow, figcaption) | Flow', 'Common'); $def->addElement('figcaption', 'Inline', 'Flow', 'Common'); } }
/** * transform some tags / attributes * * @param HTMLPurifier_Config $config */ protected function _transformBodyTags(HTMLPurifier_Config $config) { if ($def = $config->maybeGetRawHTMLDefinition()) { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Add target="_blank" to anchors'); } $a = $def->addBlankElement('a'); $a->attr_transform_post[] = new Felamimail_HTMLPurifier_AttrTransform_AValidator(); if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Add class="felamimail-body-blockquote" to blockquote tags that do not already have the class'); } $bq = $def->addBlankElement('blockquote'); $bq->attr_transform_post[] = new Felamimail_HTMLPurifier_AttrTransform_BlockquoteValidator(); } else { if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) { Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' Could not get HTMLDefinition, no transformation possible'); } } }