mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 13:47:24 +02:00
Release 1.5.0, merged in r688-867.
- LanguageFactory::instance() declared static - HTMLModuleManagerTest pass by reference bug fixed, merge back into trunk scheduled git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/strict@869 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -13,6 +13,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
function render($config) {
|
||||
$ret = '';
|
||||
$this->config =& $config;
|
||||
|
||||
$this->def = $config->getHTMLDefinition();
|
||||
$def =& $this->def;
|
||||
|
||||
@@ -21,16 +22,14 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->element('caption', 'Environment');
|
||||
|
||||
$ret .= $this->row('Parent of fragment', $def->info_parent);
|
||||
$ret .= $this->row('Strict mode', $def->strict);
|
||||
if ($def->strict) $ret .= $this->row('Block wrap name', $def->info_block_wrapper);
|
||||
$ret .= $this->renderChildren($def->info_parent_def->child);
|
||||
$ret .= $this->row('Block wrap name', $def->info_block_wrapper);
|
||||
|
||||
$ret .= $this->start('tr');
|
||||
$ret .= $this->element('th', 'Global attributes');
|
||||
$ret .= $this->element('td', $this->listifyAttr($def->info_global_attr),0,0);
|
||||
$ret .= $this->end('tr');
|
||||
|
||||
$ret .= $this->renderChildren($def->info_parent_def->child);
|
||||
|
||||
$ret .= $this->start('tr');
|
||||
$ret .= $this->element('th', 'Tag transforms');
|
||||
$list = array();
|
||||
@@ -81,8 +80,8 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->element('th', "<$name>", array('class'=>'heavy', 'colspan' => 2));
|
||||
$ret .= $this->end('tr');
|
||||
$ret .= $this->start('tr');
|
||||
$ret .= $this->element('th', 'Type');
|
||||
$ret .= $this->element('td', ucfirst($def->type));
|
||||
$ret .= $this->element('th', 'Inline content');
|
||||
$ret .= $this->element('td', $def->descendants_are_inline ? 'Yes' : 'No');
|
||||
$ret .= $this->end('tr');
|
||||
if (!empty($def->excludes)) {
|
||||
$ret .= $this->start('tr');
|
||||
@@ -130,15 +129,17 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$elements = array();
|
||||
$attr = array();
|
||||
if (isset($def->elements)) {
|
||||
if ($def->type == 'strictblockquote') $def->validateChildren(array(), $this->config, $context);
|
||||
if ($def->type == 'strictblockquote') {
|
||||
$def->validateChildren(array(), $this->config, $context);
|
||||
}
|
||||
$elements = $def->elements;
|
||||
} elseif ($def->type == 'chameleon') {
|
||||
$attr['rowspan'] = 2;
|
||||
} elseif ($def->type == 'empty') {
|
||||
$elements = array();
|
||||
} elseif ($def->type == 'table') {
|
||||
$elements = array('col', 'caption', 'colgroup', 'thead',
|
||||
'tfoot', 'tbody', 'tr');
|
||||
$elements = array_flip(array('col', 'caption', 'colgroup', 'thead',
|
||||
'tfoot', 'tbody', 'tr'));
|
||||
}
|
||||
$ret .= $this->element('th', 'Allowed children', $attr);
|
||||
|
||||
@@ -167,6 +168,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
* @param $array Tag lookup array in form of array('tagname' => true)
|
||||
*/
|
||||
function listifyTagLookup($array) {
|
||||
ksort($array);
|
||||
$list = array();
|
||||
foreach ($array as $name => $discard) {
|
||||
if ($name !== '#PCDATA' && !isset($this->def->info[$name])) continue;
|
||||
@@ -181,6 +183,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
* @todo Also add information about internal state
|
||||
*/
|
||||
function listifyObjectList($array) {
|
||||
ksort($array);
|
||||
$list = array();
|
||||
foreach ($array as $discard => $obj) {
|
||||
$list[] = $this->getClass($obj, 'AttrTransform_');
|
||||
@@ -193,6 +196,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
* @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
|
||||
*/
|
||||
function listifyAttr($array) {
|
||||
ksort($array);
|
||||
$list = array();
|
||||
foreach ($array as $name => $obj) {
|
||||
if ($obj === false) continue;
|
||||
|
Reference in New Issue
Block a user