From 2a8166cf3b64ff337eda39a2aa750e54481d59da Mon Sep 17 00:00:00 2001 From: mathematicalcoffee Date: Fri, 22 Feb 2013 12:46:21 +1000 Subject: [PATCH] Revert "FEATURE/FIX: jsdoc/util/templateHelper.getAncestorLinks: direct parents punctuation should be part of the link text. Parent~ vs Parent~" This reverts commit dad08be08a3cc92df3a73f58959c8847b7733a6c. --- lib/jsdoc/util/templateHelper.js | 7 ++----- test/specs/jsdoc/util/templateHelper.js | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/jsdoc/util/templateHelper.js b/lib/jsdoc/util/templateHelper.js index b63514c9..50d4dc2b 100644 --- a/lib/jsdoc/util/templateHelper.js +++ b/lib/jsdoc/util/templateHelper.js @@ -285,21 +285,18 @@ exports.getSignatureReturns = function(d, cssClass) { */ exports.getAncestorLinks = function(data, doclet, cssClass) { var ancestors = [], - doc = doclet.memberof, - directParent = false; + doc = doclet.memberof; while (doc) { doc = find( data, {longname: doc}, false ); if (doc) { doc = doc[0]; } if (!doc) { break; } - if (!directParent) { directParent = doc; } ancestors.unshift( linkto(doc.longname, (exports.scopeToPunc[doc.scope] || '') + doc.name, cssClass) ); doc = doc.memberof; } if (ancestors.length) { - var last = ancestors[ancestors.length - 1]; - ancestors[ancestors.length - 1] = last.replace(directParent.name, directParent.name + (exports.scopeToPunc[doclet.scope] || '')); + ancestors[ancestors.length - 1] += (exports.scopeToPunc[doclet.scope] || ''); } return ancestors; }; diff --git a/test/specs/jsdoc/util/templateHelper.js b/test/specs/jsdoc/util/templateHelper.js index cb2be6a4..96412250 100644 --- a/test/specs/jsdoc/util/templateHelper.js +++ b/test/specs/jsdoc/util/templateHelper.js @@ -712,7 +712,9 @@ describe("jsdoc/util/templateHelper", function() { var links = helper.getAncestorLinks(data, lackeys); expect(links.length).toBe(3); - expect(links).toContain('~Henchman#'); + // BUG: the link text is ~Henchman and there is a '#' on the end. + // should probably have link text ~Henchman#. + //expect(links).toContain('~Henchman#'); expect(links).toContain('.Sharks'); expect(links).toContain('mafia/gangs'); @@ -727,7 +729,7 @@ describe("jsdoc/util/templateHelper", function() { var links = helper.getAncestorLinks(data, lackeys, 'myClass'); expect(links.length).toBe(3); - expect(links).toContain('~Henchman#'); + //expect(links).toContain('~Henchman#'); expect(links).toContain('.Sharks'); expect(links).toContain('mafia/gangs');