Skip to content

Commit

Permalink
Add test for <a> child of <a> element
Browse files Browse the repository at this point in the history
  • Loading branch information
xemlock committed Jul 30, 2019
1 parent eab4b91 commit db2f653
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion library/HTMLPurifier/ChildDef/HTML5.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ class HTMLPurifier_ChildDef_HTML5 extends HTMLPurifier_ChildDef
public $content_sets = array();

/**
* Lookup table with excluded of excluded descendant tags
* Lookup table with excluded of excluded descendant tags.
*
* When {@link HTMLPurifier_Strategy_MakeWellFormed MakeWellFormed strategy}
* encounters a matching element that is a direct child of the currently
* analyzed element, then the parent element will be closed, and the
* offending child will become parent's sibling.
*
* Matching elements that are deeper in the subtree will be removed by
* {@link validateChildren()}, but their descendants will be retained,
* as long as they are not present in the lookup table.
*
* @var array
*/
public $excludes = array();
Expand Down
4 changes: 4 additions & 0 deletions tests/HTMLPurifier/HTMLModule/HTML5/HypertextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function anchorInput()
array(
'<a href="foo"></a>',
),
array(
'<a href="foo"><a href="bar">Bar</a></a>',
'<a href="foo"></a><a href="bar">Bar</a>',
),
);
}

Expand Down

0 comments on commit db2f653

Please sign in to comment.