private function processLink($text, $link) {
        $link = rtrim($link, '.');
        $pipe = explode('|', $text);

        if (mb_strlen($pipe[0]) !== mb_strlen($text)) {
            $pipe = explode('[', $pipe[0]);
            $linkText = $pipe[1];
            $search = '[' . $linkText . '|' . $link . ']';
            $replace = sprintf('<a href="%s">%s</a>', $link, $linkText);
        } else {
            $search = $link;
            $replace = sprintf('<a href="%s">%s</a>', $link, $link);
        }

        $this->writeRaw(str_replace($search, $replace, $text));

        return '';
    }