mirror of
https://github.com/moodle/moodle.git
synced 2025-07-09 16:36:28 +02:00
Prior to this change, all the line endings in the imported HTMLPurifier library were using CRLF (\r\n aka Windows style), but the HTMLPurifier source and also the downloadable artefacts use LF (\n aka Linux style) as line endings. This has been the case since510d190382
when with the commit "MDL-38672 import HTML Purifier 4.5.0" all line endings were changed from LF to CRLF. There was no comment in the commit on why this change was done. As the original source uses LF, this commit partly reverts510d190382
and goes back to LF as line endings. Signed-off-by: Daniel Ziegenberg <daniel@ziegenberg.at>
76 lines
2.3 KiB
PHP
76 lines
2.3 KiB
PHP
<?php
|
|
|
|
/**
|
|
* XHTML 1.1 Tables Module, fully defines accessible table elements.
|
|
*/
|
|
class HTMLPurifier_HTMLModule_Tables extends HTMLPurifier_HTMLModule
|
|
{
|
|
/**
|
|
* @type string
|
|
*/
|
|
public $name = 'Tables';
|
|
|
|
/**
|
|
* @param HTMLPurifier_Config $config
|
|
*/
|
|
public function setup($config)
|
|
{
|
|
$this->addElement('caption', false, 'Inline', 'Common');
|
|
|
|
$this->addElement(
|
|
'table',
|
|
'Block',
|
|
new HTMLPurifier_ChildDef_Table(),
|
|
'Common',
|
|
array(
|
|
'border' => 'Pixels',
|
|
'cellpadding' => 'Length',
|
|
'cellspacing' => 'Length',
|
|
'frame' => 'Enum#void,above,below,hsides,lhs,rhs,vsides,box,border',
|
|
'rules' => 'Enum#none,groups,rows,cols,all',
|
|
'summary' => 'Text',
|
|
'width' => 'Length'
|
|
)
|
|
);
|
|
|
|
// common attributes
|
|
$cell_align = array(
|
|
'align' => 'Enum#left,center,right,justify,char',
|
|
'charoff' => 'Length',
|
|
'valign' => 'Enum#top,middle,bottom,baseline',
|
|
);
|
|
|
|
$cell_t = array_merge(
|
|
array(
|
|
'abbr' => 'Text',
|
|
'colspan' => 'Number',
|
|
'rowspan' => 'Number',
|
|
// Apparently, as of HTML5 this attribute only applies
|
|
// to 'th' elements.
|
|
'scope' => 'Enum#row,col,rowgroup,colgroup',
|
|
),
|
|
$cell_align
|
|
);
|
|
$this->addElement('td', false, 'Flow', 'Common', $cell_t);
|
|
$this->addElement('th', false, 'Flow', 'Common', $cell_t);
|
|
|
|
$this->addElement('tr', false, 'Required: td | th', 'Common', $cell_align);
|
|
|
|
$cell_col = array_merge(
|
|
array(
|
|
'span' => 'Number',
|
|
'width' => 'MultiLength',
|
|
),
|
|
$cell_align
|
|
);
|
|
$this->addElement('col', false, 'Empty', 'Common', $cell_col);
|
|
$this->addElement('colgroup', false, 'Optional: col', 'Common', $cell_col);
|
|
|
|
$this->addElement('tbody', false, 'Required: tr', 'Common', $cell_align);
|
|
$this->addElement('thead', false, 'Required: tr', 'Common', $cell_align);
|
|
$this->addElement('tfoot', false, 'Required: tr', 'Common', $cell_align);
|
|
}
|
|
}
|
|
|
|
// vim: et sw=4 sts=4
|