/** * @return Texy\HtmlElement|string|FALSE */ function figureHandler(Texy\HandlerInvocation $invocation, Texy\Image $image, Texy\Link $link = NULL, $content, Texy\Modifier $modifier) { // finish invocation by default way $el = $invocation->proceed(); // change div -> dl $el->setName('dl'); // change p -> dd $el[1]->setName('dd'); // wrap img into dt $img = $el[0]; unset($el[0]); $dt = new Texy\HtmlElement('dt'); $dt->add($img); $el->insert(0, $dt); return $el; }