mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
use the variation to ensure a unique ID for each doclet
This commit is contained in:
parent
cd23d479a1
commit
47aad100fc
@ -67,7 +67,7 @@ function getNamespace(kind) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatNameForLink(doclet, options) {
|
function formatNameForLink(doclet, options) {
|
||||||
var newName = getNamespace(doclet.kind) + (doclet.name || '');
|
var newName = getNamespace(doclet.kind) + (doclet.name || '') + (doclet.variation || '');
|
||||||
var scopePunc = exports.scopeToPunc[doclet.scope] || '';
|
var scopePunc = exports.scopeToPunc[doclet.scope] || '';
|
||||||
|
|
||||||
// Only prepend the scope punctuation if it's not the same character that marks the start of a
|
// Only prepend the scope punctuation if it's not the same character that marks the start of a
|
||||||
|
|||||||
@ -1548,6 +1548,20 @@ describe("jsdoc/util/templateHelper", function() {
|
|||||||
|
|
||||||
expect(docletUrl).toBe('Milk.html#calcium');
|
expect(docletUrl).toBe('Milk.html#calcium');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should include the variation, if present, in the fragment ID', function() {
|
||||||
|
var variationDoclet = {
|
||||||
|
kind: 'function',
|
||||||
|
longname: 'Milk#fat(percent)',
|
||||||
|
name: 'fat',
|
||||||
|
memberof: 'Milk',
|
||||||
|
scope: 'instance',
|
||||||
|
variation: '(percent)'
|
||||||
|
};
|
||||||
|
var docletUrl = helper.createLink(variationDoclet);
|
||||||
|
|
||||||
|
expect(docletUrl).toBe('Milk.html#fat(percent)');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("resolveAuthorLinks", function() {
|
describe("resolveAuthorLinks", function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user