diff --git a/lib/jsdoc/util/templateHelper.js b/lib/jsdoc/util/templateHelper.js index 13ca389a..b74581a0 100644 --- a/lib/jsdoc/util/templateHelper.js +++ b/lib/jsdoc/util/templateHelper.js @@ -321,8 +321,9 @@ function buildLink(longname, linkText, options) { text = linkText || stripped; } // handle complex type expressions that may require multiple links - // (but skip anything that looks like an inline tag) - else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false) { + // (but skip anything that looks like an inline tag or HTML tag) + else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false && + /^<[\s\S]+>/.test(longname) === false) { parsedType = parseType(longname); return stringifyType(parsedType, options.cssClass, options.linkMap); } diff --git a/test/specs/jsdoc/util/templateHelper.js b/test/specs/jsdoc/util/templateHelper.js index 040bb792..c2cd1207 100644 --- a/test/specs/jsdoc/util/templateHelper.js +++ b/test/specs/jsdoc/util/templateHelper.js @@ -443,6 +443,13 @@ describe("jsdoc/util/templateHelper", function() { expect(link).toBe('LinktoFakeClass'); }); + it('returns the original text if an HTML tag is specified', function() { + var text = 'text'; + var link = helper.linkto(text); + + expect(link).toBe(text); + }); + it('returns the original text if an inline {@link} tag is specified', function() { var link; var text = '{@link Foo}';