mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
Revert "FEATURE/FIX: jsdoc/util/templateHelper.getAncestorLinks: direct parents punctuation should be part of the link text. <a href="">Parent~</a> vs <a href="">Parent</a>~"
This reverts commit dad08be08a3cc92df3a73f58959c8847b7733a6c.
This commit is contained in:
parent
32fe768ea7
commit
2a8166cf3b
@ -285,21 +285,18 @@ exports.getSignatureReturns = function(d, cssClass) {
|
|||||||
*/
|
*/
|
||||||
exports.getAncestorLinks = function(data, doclet, cssClass) {
|
exports.getAncestorLinks = function(data, doclet, cssClass) {
|
||||||
var ancestors = [],
|
var ancestors = [],
|
||||||
doc = doclet.memberof,
|
doc = doclet.memberof;
|
||||||
directParent = false;
|
|
||||||
|
|
||||||
while (doc) {
|
while (doc) {
|
||||||
doc = find( data, {longname: doc}, false );
|
doc = find( data, {longname: doc}, false );
|
||||||
if (doc) { doc = doc[0]; }
|
if (doc) { doc = doc[0]; }
|
||||||
if (!doc) { break; }
|
if (!doc) { break; }
|
||||||
if (!directParent) { directParent = doc; }
|
|
||||||
ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name,
|
ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name,
|
||||||
cssClass) );
|
cssClass) );
|
||||||
doc = doc.memberof;
|
doc = doc.memberof;
|
||||||
}
|
}
|
||||||
if (ancestors.length) {
|
if (ancestors.length) {
|
||||||
var last = ancestors[ancestors.length - 1];
|
ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || '');
|
||||||
ancestors[ancestors.length - 1] = last.replace(directParent.name, directParent.name + (exports.scopeToPunc[doclet.scope] || ''));
|
|
||||||
}
|
}
|
||||||
return ancestors;
|
return ancestors;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -712,7 +712,9 @@ describe("jsdoc/util/templateHelper", function() {
|
|||||||
|
|
||||||
var links = helper.getAncestorLinks(data, lackeys);
|
var links = helper.getAncestorLinks(data, lackeys);
|
||||||
expect(links.length).toBe(3);
|
expect(links.length).toBe(3);
|
||||||
expect(links).toContain('<a href="henchman.html">~Henchman#</a>');
|
// BUG: the link text is ~Henchman and there is a '#' on the end.
|
||||||
|
// should probably have link text ~Henchman#.
|
||||||
|
//expect(links).toContain('<a href="henchman.html">~Henchman#</a>');
|
||||||
expect(links).toContain('.Sharks');
|
expect(links).toContain('.Sharks');
|
||||||
expect(links).toContain('<a href="mafia_gangs.html">mafia/gangs</a>');
|
expect(links).toContain('<a href="mafia_gangs.html">mafia/gangs</a>');
|
||||||
|
|
||||||
@ -727,7 +729,7 @@ describe("jsdoc/util/templateHelper", function() {
|
|||||||
|
|
||||||
var links = helper.getAncestorLinks(data, lackeys, 'myClass');
|
var links = helper.getAncestorLinks(data, lackeys, 'myClass');
|
||||||
expect(links.length).toBe(3);
|
expect(links.length).toBe(3);
|
||||||
expect(links).toContain('<a href="henchman.html" class="myClass">~Henchman#</a>');
|
//expect(links).toContain('<a href="henchman.html" class="myClass">~Henchman#</a>');
|
||||||
expect(links).toContain('.Sharks');
|
expect(links).toContain('.Sharks');
|
||||||
expect(links).toContain('<a href="mafia_gangs.html" class="myClass">mafia/gangs</a>');
|
expect(links).toContain('<a href="mafia_gangs.html" class="myClass">mafia/gangs</a>');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user