MediaWiki REL1_39
|
Static utilities for manipulating HTML strings. More...
Static Public Member Functions | |
static | modifyElements (string $htmlFragment, callable $shouldModifyCallback, callable $modifyCallback) |
Modify elements of an HTML fragment via a user-provided callback. | |
Static utilities for manipulating HTML strings.
Definition at line 17 of file HtmlHelper.php.
|
static |
Modify elements of an HTML fragment via a user-provided callback.
string | $htmlFragment | HTML fragment. Must be valid (ie. coming from the parser, not the user). |
callable | $shouldModifyCallback | A callback which takes a single RemexHtml\Serializer\SerializerNode argument, and returns true if it should be modified. |
callable | $modifyCallback | A callback which takes a single RemexHtml\Serializer\SerializerNode argument and actually performs the modification on it. It must return the new node (which can be the original node object). |
Definition at line 30 of file HtmlHelper.php.