本文整理匯總了PHP中HTMLPurifier_Config::maybeGetRawHTMLDefinition方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTMLPurifier_Config::maybeGetRawHTMLDefinition方法的具體用法?PHP HTMLPurifier_Config::maybeGetRawHTMLDefinition怎麽用?PHP HTMLPurifier_Config::maybeGetRawHTMLDefinition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTMLPurifier_Config
的用法示例。
在下文中一共展示了HTMLPurifier_Config::maybeGetRawHTMLDefinition方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: html5Config
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');
}
}
示例2: _transformBodyTags
/**
* 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');
}
}
}