Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
Fix: Last tag always has \n in the description (fixes #87)
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK committed Oct 4, 2015
1 parent dbc9f28 commit fea8db3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/doctrine.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
index += 1;
}

return result;
return result.replace(/\s+$/, '');
}

// JSDoc Tag Parser
Expand Down
8 changes: 4 additions & 4 deletions test/unwrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require('should');

describe('unwrapComment', function () {
it('normal', function () {
doctrine.unwrapComment('/**\n * @const\n * @const\n */').should.equal('\n@const\n@const\n');
doctrine.unwrapComment('/**\n * @const\n * @const\n */').should.equal('\n@const\n@const');
});

it('single', function () {
Expand All @@ -46,15 +46,15 @@ describe('unwrapComment', function () {
});

it('2 lines', function () {
doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\ny\n');
doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\ny');
});

it('2 lines with space', function () {
doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\n y\n');
doctrine.unwrapComment('/**x\n * y\n*/').should.equal('x\n y');
});

it('3 lines with blank line', function () {
doctrine.unwrapComment('/**x\n *\n \* y\n*/').should.equal('x\n\ny\n');
doctrine.unwrapComment('/**x\n *\n \* y\n*/').should.equal('x\n\ny');
});
});
/* vim: set sw=4 ts=4 et tw=80 : */

0 comments on commit fea8db3

Please sign in to comment.