public function enterTag(Tag $node) { $name = $node->getTagName(); $flags = $node->getFlags(); if ($flags & Tag::FLAG_REMOVE_INNER_WHITESPACES) { $name .= '<'; } if ($flags & Tag::FLAG_REMOVE_OUTER_WHITESPACES) { $name .= '>'; } if ($flags & Tag::FLAG_SELF_CLOSE) { $name .= '/'; } $this->write('tag(' . $name, true, false)->indent(); if ($node->hasContent()) { $this->raw(' '); $node->getContent()->accept($this); } if ($node->hasAttributes() || $node->hasChilds()) { $this->raw("\n"); } }