mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
don't try to parse HTML tags as type expressions (hegemonic/jsdoc-baseline#149)
This commit is contained in:
parent
951e9ef881
commit
0b41c89f83
@ -321,8 +321,9 @@ function buildLink(longname, linkText, options) {
|
|||||||
text = linkText || stripped;
|
text = linkText || stripped;
|
||||||
}
|
}
|
||||||
// handle complex type expressions that may require multiple links
|
// handle complex type expressions that may require multiple links
|
||||||
// (but skip anything that looks like an inline tag)
|
// (but skip anything that looks like an inline tag or HTML tag)
|
||||||
else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false) {
|
else if (longname && isComplexTypeExpression(longname) && /\{\@.+\}/.test(longname) === false &&
|
||||||
|
/^<[\s\S]+>/.test(longname) === false) {
|
||||||
parsedType = parseType(longname);
|
parsedType = parseType(longname);
|
||||||
return stringifyType(parsedType, options.cssClass, options.linkMap);
|
return stringifyType(parsedType, options.cssClass, options.linkMap);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -443,6 +443,13 @@ describe("jsdoc/util/templateHelper", function() {
|
|||||||
expect(link).toBe('<a href="fakeclass.html#fragment">LinktoFakeClass</a>');
|
expect(link).toBe('<a href="fakeclass.html#fragment">LinktoFakeClass</a>');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('returns the original text if an HTML <a> tag is specified', function() {
|
||||||
|
var text = '<a href="http://example.com">text</a>';
|
||||||
|
var link = helper.linkto(text);
|
||||||
|
|
||||||
|
expect(link).toBe(text);
|
||||||
|
});
|
||||||
|
|
||||||
it('returns the original text if an inline {@link} tag is specified', function() {
|
it('returns the original text if an inline {@link} tag is specified', function() {
|
||||||
var link;
|
var link;
|
||||||
var text = '{@link Foo}';
|
var text = '{@link Foo}';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user