mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 21:57:26 +02:00
Remove trailing whitespace.
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
This commit is contained in:
@@ -2,30 +2,30 @@
|
||||
|
||||
class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Instance of HTMLPurifier_HTMLDefinition, for easy access
|
||||
*/
|
||||
protected $def;
|
||||
|
||||
|
||||
public function render($config) {
|
||||
$ret = '';
|
||||
$this->config =& $config;
|
||||
|
||||
|
||||
$this->def = $config->getHTMLDefinition();
|
||||
|
||||
|
||||
$ret .= $this->start('div', array('class' => 'HTMLPurifier_Printer'));
|
||||
|
||||
|
||||
$ret .= $this->renderDoctype();
|
||||
$ret .= $this->renderEnvironment();
|
||||
$ret .= $this->renderContentSets();
|
||||
$ret .= $this->renderInfo();
|
||||
|
||||
|
||||
$ret .= $this->end('div');
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the Doctype table
|
||||
*/
|
||||
@@ -41,28 +41,28 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->end('table');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Renders environment table, which is miscellaneous info
|
||||
*/
|
||||
protected function renderEnvironment() {
|
||||
$def = $this->def;
|
||||
|
||||
|
||||
$ret = '';
|
||||
|
||||
|
||||
$ret .= $this->start('table');
|
||||
$ret .= $this->element('caption', 'Environment');
|
||||
|
||||
|
||||
$ret .= $this->row('Parent of fragment', $def->info_parent);
|
||||
$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->start('tr');
|
||||
$ret .= $this->element('th', 'Tag transforms');
|
||||
$list = array();
|
||||
@@ -72,21 +72,21 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
}
|
||||
$ret .= $this->element('td', $this->listify($list));
|
||||
$ret .= $this->end('tr');
|
||||
|
||||
|
||||
$ret .= $this->start('tr');
|
||||
$ret .= $this->element('th', 'Pre-AttrTransform');
|
||||
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_pre));
|
||||
$ret .= $this->end('tr');
|
||||
|
||||
|
||||
$ret .= $this->start('tr');
|
||||
$ret .= $this->element('th', 'Post-AttrTransform');
|
||||
$ret .= $this->element('td', $this->listifyObjectList($def->info_attr_transform_post));
|
||||
$ret .= $this->end('tr');
|
||||
|
||||
|
||||
$ret .= $this->end('table');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the Content Sets table
|
||||
*/
|
||||
@@ -103,7 +103,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->end('table');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renders the Elements ($info) table
|
||||
*/
|
||||
@@ -152,18 +152,18 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->element('th', 'Allowed attributes');
|
||||
$ret .= $this->element('td',$this->listifyAttr($def->attr), array(), 0);
|
||||
$ret .= $this->end('tr');
|
||||
|
||||
|
||||
if (!empty($def->required_attr)) {
|
||||
$ret .= $this->row('Required attributes', $this->listify($def->required_attr));
|
||||
}
|
||||
|
||||
|
||||
$ret .= $this->renderChildren($def->child);
|
||||
}
|
||||
$ret .= $this->end('table');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Renders a row describing the allowed children of an element
|
||||
* @param $def HTMLPurifier_ChildDef of pertinent element
|
||||
*/
|
||||
@@ -188,9 +188,9 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
'tfoot', 'tbody', 'tr'));
|
||||
}
|
||||
$ret .= $this->element('th', 'Allowed children', $attr);
|
||||
|
||||
|
||||
if ($def->type == 'chameleon') {
|
||||
|
||||
|
||||
$ret .= $this->element('td',
|
||||
'<em>Block</em>: ' .
|
||||
$this->escape($this->listifyTagLookup($def->block->elements)),0,0);
|
||||
@@ -199,12 +199,12 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->element('td',
|
||||
'<em>Inline</em>: ' .
|
||||
$this->escape($this->listifyTagLookup($def->inline->elements)),0,0);
|
||||
|
||||
|
||||
} elseif ($def->type == 'custom') {
|
||||
|
||||
|
||||
$ret .= $this->element('td', '<em>'.ucfirst($def->type).'</em>: ' .
|
||||
$def->dtd_regex);
|
||||
|
||||
|
||||
} else {
|
||||
$ret .= $this->element('td',
|
||||
'<em>'.ucfirst($def->type).'</em>: ' .
|
||||
@@ -213,8 +213,8 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->end('tr');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* Listifies a tag lookup table.
|
||||
* @param $array Tag lookup array in form of array('tagname' => true)
|
||||
*/
|
||||
@@ -227,7 +227,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
}
|
||||
return $this->listify($list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Listifies a list of objects by retrieving class names and internal state
|
||||
* @param $array List of objects
|
||||
@@ -241,7 +241,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
}
|
||||
return $this->listify($list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Listifies a hash of attributes to AttrDef classes
|
||||
* @param $array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)
|
||||
@@ -255,7 +255,7 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
}
|
||||
return $this->listify($list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a heavy header row
|
||||
*/
|
||||
@@ -266,6 +266,6 @@ class HTMLPurifier_Printer_HTMLDefinition extends HTMLPurifier_Printer
|
||||
$ret .= $this->end('tr');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user