Skip to content

Commit c771b25

Browse files
committed
Fix: slightly correct description calculation
1 parent d91140d commit c771b25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/jsdoc.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,11 @@ function DocComment(value, loc) {
6363
this.valid = _parsed.hasOwnProperty('line');
6464

6565
// doc parsed data
66-
this.description = _parsed.source && _parsed.description ?
67-
_parsed.source.substr(0, _parsed.source.indexOf('\n@')) : null;
66+
var _d = _parsed.source;
67+
var _dog = _d && _d.indexOf('\n@');
68+
this.description = !_d || _d[0] === '@' ?
69+
null
70+
: (_dog === -1 ? _d : _d.substr(0, _dog));
6871

6972
this.tags = (_parsed.tags || []).map(function(tag) {
7073
return new DocTag(tag, new DocLocation(tag.line, 3, loc.start));

0 commit comments

Comments
 (0)