Skip to content

Instantly share code, notes, and snippets.

@buzzeins
Created February 23, 2014 09:40
Show Gist options
  • Save buzzeins/9169262 to your computer and use it in GitHub Desktop.
Save buzzeins/9169262 to your computer and use it in GitHub Desktop.
<?
if ($params['parsemode'] == 'html') {
// config jevix
$this->jevix->cfgAllowTags(array('cut','a', 'img', 'div', 'span', 'i', 'b', 'u', 's', 'video', 'em', 'strong', 'nobr', 'li', 'ol', 'ul', 'sup', 'abbr', 'sub', 'acronym', 'h4', 'h5', 'h6', 'br', 'hr', 'pre', 'code', 'object', 'param', 'embed', 'blockquote', 'file'));
// $this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut', 'param'));
$this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut'));
$this->jevix->cfgSetTagPreformatted(array('pre','code','video'));
$this->jevix->cfgAllowTagParams('img', array('src', 'alt' => '#text', 'title', 'align' => array('right', 'left', 'center'), 'width' => '#int', 'height' => '#int', 'hspace' => '#int', 'vspace' => '#int'));
$this->jevix->cfgAllowTagParams('a', array('title', 'href', 'rel', 'class'));
$this->jevix->cfgAllowTagParams('div', array('class'));
$this->jevix->cfgAllowTagParams('span', array('class'));
$this->jevix->cfgAllowTagParams('cut', array('name'));
$this->jevix->cfgAllowTagParams('object', array('width' => '#int', 'height' => '#int', 'data' => '#link'));
$this->jevix->cfgAllowTagParams('param', array('name' => '#text', 'value' => '#text'));
$this->jevix->cfgAllowTagParams('embed', array('src' => '#image', 'type' => '#text','allowscriptaccess' => '#text', 'allowfullscreen' => '#text','width' => '#int', 'height' => '#int', 'flashvars'=> '#text', 'wmode'=> '#text'));
$this->jevix->cfgSetTagParamsRequired('img', 'src');
$this->jevix->cfgSetTagParamsRequired('a', 'href');
$this->jevix->cfgSetTagCutWithContent(array('script', 'iframe', 'style'));
/**
* @todo´: umschreiben, wie unten bei object
*/
$this->jevix->cfgSetTagChilds('ul', array('li'), false, true);
$this->jevix->cfgSetTagChilds('ol', array('li'), false, true);
$this->jevix->cfgSetTagChilds('object', 'param', false, false);
$this->jevix->cfgSetTagChilds('object', 'embed', false, false);
$this->jevix->cfgSetTagIsEmpty (array('param','embed'));
$this->jevix->cfgSetTagNoTypography('video');
// Теги с обязательными параметрами
// $this->jevix->cfgSetTagParamsAutoAdd('embed',array(array('name'=>'wmode','value'=>'opaque','rewrite'=>true)));
/*
if (BLOG_URL_NO_INDEX) {
$this->jevix->cfgSetTagParamsAutoAdd('a',array(array('name'=>'rel','value'=>'nofollow','rewrite'=>true)));
}
*/
}
if ($params['parsemode'] == 'markdown') {
// config jevix
// $this->jevix->cfgAllowTags(array('hr', 'br', 'cut', 'code'));
$this->jevix->cfgAllowTags(array('cut','a', 'img', 'div', 'span', 'i', 'b', 'u', 's', 'video', 'em', 'strong', 'nobr', 'li', 'ol', 'ul', 'sup', 'abbr', 'sub', 'acronym', 'h4', 'h5', 'h6', 'br', 'hr', 'pre', 'code', 'object', 'param', 'embed', 'blockquote', 'file'));
// $this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut', 'param'));
$this->jevix->cfgSetTagShort(array('br','img', 'hr', 'cut'));
$this->jevix->cfgSetTagPreformatted(array('pre','code','video'));
$this->jevix->cfgAllowTagParams('img', array('src', 'alt' => '#text', 'title', 'align' => array('right', 'left', 'center'), 'width' => '#int', 'height' => '#int', 'hspace' => '#int', 'vspace' => '#int'));
$this->jevix->cfgAllowTagParams('a', array('title', 'href', 'rel', 'class'));
$this->jevix->cfgAllowTagParams('div', array('class'));
$this->jevix->cfgAllowTagParams('span', array('class'));
$this->jevix->cfgAllowTagParams('cut', array('name'));
$this->jevix->cfgSetTagChilds('ul', array('li'), false, true);
$this->jevix->cfgSetTagChilds('ol', array('li'), false, true);
$this->jevix->cfgSetTagPreformatted(array('code'));
$this->jevix->cfgAllowTagParams('cut', array('name'));
}
//$this->oJevix->cfgSetAutoBrMode(false);
$this->jevix->cfgSetAutoReplace(array('+/-', '(c)', '(r)', '(C)', '(R)'), array('±', '©', '®', '©', '®'));
// $this->oJevix->cfgSetXHTMLMode(false);
$this->jevix->cfgSetTagNoTypography('code');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment