function customResolveLinks(html) {
    console.assert(!!docletMap, 'No doclet map!');

    // Do the standard link resolution first.
    html = helper.resolveLinks(html);

    // Now do our custom link resolution.
    const customReplacers = {
        linksource: (string, tagInfo) => {
            const longname = tagInfo.text;
            const doclet = docletMap[longname];
            if (!doclet) {
                logger.fatal('Unknown linksource target: %s', longname);
                return '';
            }

            const link = linkto(
                /* destination */ doclet.meta.shortpath,
                /* link text */ longname,
                /* css class */ null,
                /* fragment */ 'line' + doclet.meta.lineno);
            return string.replace(tagInfo.completeTag, link);
        },
    };

    return inline.replaceInlineTags(html, customReplacers).newString;
}
@fileoverview The publication code for the JSDoc template.

Forked by Shaka Player team from the default template in JSDoc.