Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function registerLink(doclet) {
var url = helper.createLink(doclet);
helper.registerLink(doclet.longname, url);
doclet.rstLink = url.substr(0, url.length - helper.fileExtension.length);
// Parent link
if (!doclet.memberof) {
return;
}
var parent;
parent = helper.find(context.data, {longname: doclet.memberof});
if (parent && parent.length > 0) {
doclet.parentRstLink = parent[0].rstLink;
}
// Reference code
doclet.rstReference = doclet.parentRstLink + '.' + doclet.name;
}
id(doclet) {
let fileUrl;
let hash;
doclet = doclet || {};
if (!{}.hasOwnProperty.call(ids, doclet.longname)) {
fileUrl = templateHelper.createLink(doclet);
hash = url.parse(fileUrl).hash;
if (hash) {
// strip the hash character
hash = hash.replace(/^#/, '');
} else {
// as a fallback, use the name and variation
hash = doclet.name + (doclet.variation || '');
}
ids[doclet.longname] = hash;
}
return ids[doclet.longname];
},
function hashToLink(doclet, hash) {
if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
url = url.replace(/(#.+|$)/, hash);
return '<a href="' + url + '">' + hash + '</a>';
}
function hashToLink(doclet, hash) {
if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
url = url.replace(/(#.+|$)/, hash);
return '<a href="' + url + '">' + hash + '</a>';
}
function hashToLink(doclet, hash) {
if (!/^(#.+)/.test(hash)) {
return hash
}
var url = helper.createLink(doclet)
url = url.replace(/(#.+|$)/, hash)
return '<a href="' + url + '">' + hash + '</a>'
}
function hashToLink(doclet, hash) {
if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
url = url.replace(/(#.+|$)/, hash);
return '<a href="' + url + '">' + hash + '</a>';
}
function hashToLink(doclet, hash) {
if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
url = url.replace(/(#.+|$)/, hash);
return '<a href="' + url + '">' + hash + '</a>';
}
function hashToLink( doclet, hash ) {
if ( !/^(#.+)/.test( hash ) ) { return hash; }
var url = helper.createLink( doclet );
url = url.replace( /(#.+|$)/, hash );
return '<a href="' + url + '">' + hash + '</a>';
}
function hashToLink(doclet, hash) {
if ( !/^(#.+)/.test(hash) ) { return hash; }
var url = helper.createLink(doclet);
url = url.replace(/(#.+|$)/, hash);
return '<a href="' + url + '">' + hash + '</a>';
}