diff --git a/include/common.php b/include/common.php index bb5e28e..f4dfe20 100644 --- a/include/common.php +++ b/include/common.php @@ -45,7 +45,7 @@ gp_defined('notify_deprecated', true); // Since 5.2 //gp_defined('CMS_DOMAIN', 'http://gpeasy.loc'); gp_defined('CMS_DOMAIN', 'https://github.com/gtbu'); gp_defined('CMS_READABLE_DOMAIN', 'github.com/gtbu'); -gp_defined('CMS_NAME', 'Typesetter'); +gp_defined('CMS_NAME', 'Typesetter5'); gp_defined('CMS_NAME_FULL', 'Typesetter5 CMS'); gp_defined('addon_browse_path', CMS_DOMAIN . '/index.php'); gp_defined('debug_path', CMS_DOMAIN . '/index.php/Debug'); diff --git a/include/thirdparty/dom/NodeList.php b/include/thirdparty/dom/NodeList.php index 4dc5b70..bdaa946 100644 --- a/include/thirdparty/dom/NodeList.php +++ b/include/thirdparty/dom/NodeList.php @@ -30,7 +30,7 @@ class NodeList extends NodeCollection * @param Document $document * @param iterable $nodes */ - public function __construct(Document $document = null, ?iterable $nodes = null) { + public function __construct(?Document $document = null, ?iterable $nodes = null) { parent::__construct($nodes); $this->document = $document; diff --git a/include/thirdparty/dom/README.md b/include/thirdparty/dom/README.md index ffda30f..a11f118 100644 --- a/include/thirdparty/dom/README.md +++ b/include/thirdparty/dom/README.md @@ -500,9 +500,21 @@ $doc->find('div').removeClass('first'); self substituteWith(string|NodeList|\DOMNode|callable $input) ``` +Replace each node in the current set with the contents provided. + ##### Example ``` php +$doc = (new Document())->html('
Hello World!
'); +$doc->find('b')->substituteWith(function($node) { + return '' . $node->text() . ''; +}); +echo $doc->html(); +``` + +*Result:* +``` html +Hello World!
``` --- @@ -513,9 +525,33 @@ self substituteWith(string|NodeList|\DOMNode|callable $input) string|self text([string|NodeList|\DOMNode|callable $input = null]) ``` -##### Example +Get the text contents of the current set. + +##### Example (get) ``` php +$doc = (new Document())->html('