/**
* Finish invocation.
* @return Texy\HtmlElement
*/
public function solve(Texy\HandlerInvocation $invocation, $phrase, $content, Modifier $mod, Texy\Link $link = NULL)
{
$texy = $this->texy;
$tag = isset($this->tags[$phrase]) ? $this->tags[$phrase] : NULL;
if ($tag === 'a') {
$tag = $link && $this->linksAllowed ? NULL : 'span';
}
if ($phrase === 'phrase/code') {
$content = $texy->protect(htmlspecialchars($content, ENT_NOQUOTES, 'UTF-8'), $texy::CONTENT_TEXTUAL);
}
if ($phrase === 'phrase/strong+em') {
$el = new Texy\HtmlElement($this->tags['phrase/strong']);
$el->create($this->tags['phrase/em'], $content);
$mod->decorate($texy, $el);
} elseif ($tag) {
$el = new Texy\HtmlElement($tag, $content);
$mod->decorate($texy, $el);
if ($tag === 'q') {
$el->attrs['cite'] = $mod->cite;
}
} else {
$el = $content;
// trick
}
if ($link && $this->linksAllowed) {
return $texy->linkModule->solve(NULL, $link, $el);
}
return $el;
}