Modern DOM library written in PHP for HTML documents
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace dW\HTML5;
|
|
|
|
|
|
|
|
class Text extends \DOMText {
|
|
|
|
use EscapeString, Moonwalk;
|
|
|
|
|
|
|
|
function __toString(): string {
|
|
|
|
# If the parent of current node is a style, script, xmp, iframe, noembed,
|
|
|
|
# noframes, or plaintext element, or if the parent of current node is a noscript
|
|
|
|
# element and scripting is enabled for the node, then append the value of
|
|
|
|
# current node’s data IDL attribute literally.
|
|
|
|
// DEVIATION: No scripting.
|
|
|
|
|
|
|
|
# Otherwise, append the value of current node’s data IDL attribute, escaped as
|
|
|
|
# described below.
|
|
|
|
return $this->escapeString($this->data);
|
|
|
|
}
|
|
|
|
}
|