element instanceof \PhpOffice\PhpWord\Element\Title) { return ''; } $tag = 'h' . $this->element->getDepth(); $text = $this->element->getText(); if (is_string($text)) { if (Settings::isOutputEscapingEnabled()) { $text = $this->escaper->escapeHtml($text); } } elseif ($text instanceof \PhpOffice\PhpWord\Element\AbstractContainer) { $writer = new Container($this->parentWriter, $text); $text = $writer->write(); } $content = "<{$tag}>{$text}" . PHP_EOL; return $content; } }