Skip to content

Commit

Permalink
feat: classdesc can also contain link (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jul 8, 2021
1 parent 1b68c80 commit e57b3ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ exports.handlers = {
if (e.doclet.description) {
e.doclet.description = replaceRelativeLinks(e.doclet.description);
}
if (e.doclet.classdesc) {
e.doclet.classdesc = replaceRelativeLinks(e.doclet.classdesc);
}

const examples = e.doclet.examples;

Expand Down
12 changes: 12 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ describe('jsdoc-region-tag', () => {
'My description <a href="https://cloud.google.com/foo">foo link</a>'
);
});
it('replaces single link in classdesc', () => {
const doc = {
doclet: {
classdesc: 'My description <a href="/foo">foo link</a>',
},
};
handlers.newDoclet(doc);
assert.strictEqual(
doc.doclet.classdesc,
'My description <a href="https://cloud.google.com/foo">foo link</a>'
);
});
it('replaces multiple links in description', () => {
const doc = {
doclet: {
Expand Down

0 comments on commit e57b3ad

Please sign in to comment.