You are here

public function OutputRules::text in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php \Masterminds\HTML5\Serializer\OutputRules::text()

Write a text node.

Parameters

\DOMText $ele: The text node to write.

Overrides RulesInterface::text

File

vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php, line 248
The rules for generating output in the serializer.

Class

OutputRules
Generate the output html5 based on element rules.

Namespace

Masterminds\HTML5\Serializer

Code

public function text($ele) {
  if (isset($ele->parentNode) && isset($ele->parentNode->tagName) && Elements::isA($ele->parentNode->localName, Elements::TEXT_RAW)) {
    $this
      ->wr($ele->data);
    return;
  }

  // FIXME: This probably needs some flags set.
  $this
    ->wr($this
    ->enc($ele->data));
}