Update allowed attributes in the Markdown Prefilter, to be less strict.

Fix issue 578
feature.content-md5
William MARTIN 2011-06-01 10:10:01 +02:00
parent de09c8af56
commit d350876bc1
1 changed files with 63 additions and 34 deletions

View File

@ -90,40 +90,69 @@ class IDF_Template_MarkdownPrefilter extends Pluf_Text_HTML_Filter
); );
public $allowed = array( public $allowed = array(
'a' => array('href', 'title', 'rel'), 'a' => array('class', 'dir', 'id', 'style', 'title',
'abbr' => array('title'), 'href', 'hreflang', 'rel'),
'address' => array(), 'abbr' => array('class', 'dir', 'id', 'style', 'title'),
'b' => array(), 'address' => array('class', 'dir', 'id', 'style', 'title'),
'blockquote' => array(), 'b' => array('class', 'dir', 'id', 'style', 'title'),
'br' => array(), 'blockquote' => array('class', 'dir', 'id', 'style', 'title',
'caption' => array(), 'cite'),
'code' => array(), 'br' => array('class', 'id', 'style', 'title'),
'dd' => array(), 'caption' => array('class', 'dir', 'id', 'style', 'title',
'del' => array('cite', 'class', 'datetime', 'dir', 'id', 'title'), 'align'), // deprecated attribute),
'div' => array('align', 'class'), 'code' => array('class', 'dir', 'id', 'style', 'title'),
'dl' => array(), 'dd' => array('class', 'dir', 'id', 'style', 'title'),
'dt' => array(), 'del' => array('class', 'dir', 'id', 'style', 'title',
'em' => array(), 'cite', 'datetime'),
'h1' => array('id'), 'div' => array('class', 'dir', 'id', 'style', 'title',
'h2' => array('id'), 'align'), // deprecated attribute
'h3' => array('id'), 'dl' => array('class', 'dir', 'id', 'style', 'title'),
'h4' => array('id'), 'dt' => array('class', 'dir', 'id', 'style', 'title'),
'h5' => array('id'), 'em' => array('class', 'dir', 'id', 'style', 'title'),
'h6' => array('id'), 'font' => array('class', 'dir', 'id', 'style', 'title', // deprecated element
'hr' => array(), 'color', 'face', 'size'); // deprecated attribute
'i' => array(), 'h1' => array('class', 'dir', 'id', 'style', 'title',
'img' => array('src', 'class', 'alt', 'height', 'width', 'style'), 'align'), // deprecated attribute
'ins' => array('cite', 'class', 'datetime', 'dir', 'id', 'title'), 'h2' => array('class', 'dir', 'id', 'style', 'title',
'li' => array(), 'align'), // deprecated attribute
'ol' => array(), 'h3' => array('class', 'dir', 'id', 'style', 'title',
'p' => array('align', 'class'), 'align'), // deprecated attribute
'pre' => array(), 'h4' => array('class', 'dir', 'id', 'style', 'title',
'strong' => array(), 'align'), // deprecated attribute
'table' => array('summary'), 'h5' => array('class', 'dir', 'id', 'style', 'title',
'td' => array('style'), 'align'), // deprecated attribute
'th' => array(), 'h6' => array('class', 'dir', 'id', 'style', 'title',
'tr' => array(), 'align'), // deprecated attribute
'ul' => array(), 'hr' => array('class', 'dir', 'id', 'style', 'title',
'align', 'noshade', 'size', 'width'), // deprecated attribute
'i' => array('class', 'dir', 'id', 'style', 'title'),
'img' => array('class', 'dir', 'id', 'style', 'title',
'src', 'alt', 'height', 'width'),
'ins' => array('class', 'dir', 'id', 'style', 'title',
'cite', 'datetime'),
'li' => array('class', 'dir', 'id', 'style', 'title',
'type'), // deprecated attribute
'ol' => array('class', 'dir', 'id', 'style', 'title',
'type'), // deprecated attribute
'p' => array('class', 'dir', 'id', 'style', 'title',
'align'), // deprecated attribute
'pre' => array('class', 'dir', 'id', 'style', 'title',
'width'), // deprecated attribute
'strong' => array('class', 'dir', 'id', 'style', 'title'),
'table' => array('class', 'dir', 'id', 'style', 'title',
'border', 'cellpadding', 'cellspacing', 'frame', 'rules', 'summary', 'width',
'align', 'bgcolor'), // deprecated attribute
'td' => array('class', 'dir', 'id', 'style', 'title',
'align', 'colspan', 'headers', 'rowspan', 'scope', 'valign',
'bgcolor', 'height', 'nowrap', 'width'), // deprecated attribute
'th' => array('class', 'dir', 'id', 'style', 'title',
'align', 'colspan', 'rowspan', 'scope', 'valign',
'bgcolor', 'height', 'nowrap', 'width'), // deprecated attribute
'tr' => array('class', 'dir', 'id', 'style', 'title',
'align', 'valign',
'bgcolor'), // deprecated attribute
'ul' => array('class', 'dir', 'id', 'style', 'title',
'type'), // deprecated attribute
); );
// tags which should always be self-closing (e.g. "<img />") // tags which should always be self-closing (e.g. "<img />")
public $no_close = array( public $no_close = array(