protected function stripLinkBase($link)
    {
        // Trim baseURL
        $link = preg_replace('/^' . preg_quote(Director::baseURL(), '/') .'/', '', $link);

        // Trim link_base
        if ($linkBase = Config::inst()->get('DocumentationViewer', 'link_base')) {
            $link = preg_replace('/^' . preg_quote($linkBase, '/') .'\/?/', '', $link);
        }

        return $link;
    }