/** * Execute the token * * @param \Zend\Markup\Token $token * * @return string */ protected function _execute(Token $token) { switch ($token->getType()) { case Token::TYPE_MARKUP: if (!isset($this->_markups[$token->getName()])) { // TODO: apply filters return $this->_markup->filter($token->getContent()) . $this->_render($token) . $this->_markup->filter($token->getStopper()); } $markup = $this->_markups[$token->getName()]; // change the rendering environiment $oldMarkup = $this->_markup; $this->_markup = $markup; $value = $markup($token, $this->_render($token)); // and change the rendering environiment back $this->_markup = $oldMarkup; return $value; break; case Token::TYPE_NONE: default: return $this->_markup->filter($token->getContent()); break; } }