Skip to content

Commit

Permalink
Add HTML5 spec compliant <caption> definition (xemlock#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
codebymikey committed Aug 4, 2022
1 parent 941bc75 commit 3924d1e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTML5Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class HTMLPurifier_HTML5Config extends HTMLPurifier_Config
{
const REVISION = 2021091901;
const REVISION = 2022080401;

/**
* @param string|array|HTMLPurifier_Config $config
Expand Down
2 changes: 1 addition & 1 deletion library/HTMLPurifier/HTMLModule/HTML5/Tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class HTMLPurifier_HTMLModule_HTML5_Tables extends HTMLPurifier_HTMLModule
*/
public function setup($config)
{
$this->addElement('caption', false, 'Inline', 'Common');
$this->addElement('caption', false, 'Flow', 'Common');

$this->addElement('table', 'Block', new HTMLPurifier_ChildDef_HTML5_Table(), 'Common');

Expand Down
4 changes: 4 additions & 0 deletions tests/HTMLPurifier/HTMLModule/HTML5/TablesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ public function dataProvider()
{
return array(
array('<table></table>'),
array('<table><caption><h3>foo</h3><p>bar<p>baz</caption></table>', '<table><caption><h3>foo</h3><p>bar</p><p>baz</p></caption></table>'),
array('<table><caption><h3>foo</h3></caption></table>'),
array('<table><caption><p>foo<p>bar</caption></table>', '<table><caption><p>foo</p><p>bar</p></caption></table>'),
array('<table><caption>foo</caption></table>'),
array('<table><thead><tr><th>foo</th></tr></thead></table>'),
array('<table><tr><th>foo</th></tr></table>'),
array('<table><tbody><tr><th>foo</th></tr></tbody></table>'),
Expand Down

0 comments on commit 3924d1e

Please sign in to comment.