mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
escape less-than sign in signature headings (#307)
This commit is contained in:
parent
2ad44a6c6a
commit
4a57a3718c
@ -231,8 +231,8 @@ exports.getSignatureParams = function(d, optClass) {
|
||||
|
||||
/**
|
||||
* Retrieve links to types that the member can return.
|
||||
* @param {object} d The doclet whose types will be retrieved.
|
||||
* @return {array<string>} HTML links to types that the member can return.
|
||||
* @param {Object} d The doclet whose types will be retrieved.
|
||||
* @return {Array.<string>} HTML links to types that the member can return.
|
||||
*/
|
||||
exports.getSignatureReturns = function(d) {
|
||||
var returnTypes = [];
|
||||
@ -249,7 +249,7 @@ exports.getSignatureReturns = function(d) {
|
||||
|
||||
if (returnTypes && returnTypes.length) {
|
||||
returnTypes = returnTypes.map(function(r) {
|
||||
return linkto(r);
|
||||
return linkto(r, htmlsafe(r));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -321,8 +321,26 @@ describe("jsdoc/util/templateHelper", function() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
xdescribe("getSignatureReturns", function() {
|
||||
// TODO
|
||||
describe("getSignatureReturns", function() {
|
||||
// TODO: more tests
|
||||
|
||||
it("returns a value with correctly escaped HTML", function() {
|
||||
var mockDoclet = {
|
||||
returns: [
|
||||
{
|
||||
type: {
|
||||
names: [
|
||||
'Array.<string>'
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var html = helper.getSignatureReturns(mockDoclet);
|
||||
expect( html.indexOf('Array.<string>') ).toEqual(-1);
|
||||
expect( html.indexOf('Array.<string>') ).toBeGreaterThan(-1);
|
||||
});
|
||||
});
|
||||
|
||||
xdescribe("getAncestorLinks", function() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user