Skip to content

Commit

Permalink
Merge pull request #8 from inossidabile/summary-inline-dots
Browse files Browse the repository at this point in the history
Comments can contain inline dots
  • Loading branch information
netzpirat committed Feb 20, 2012
2 parents 4318b40 + c1a6ddf commit 89f29f9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/nodes/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
}
}
text = comment.join('\n');
this.summary = _.str.clean(((_ref = /((?:.|\n)*?\.)/.exec(text)) != null ? _ref[1] : void 0) || text);
this.summary = _.str.clean(((_ref = /((?:.|\n)*?\.[\s$])/.exec(text)) != null ? _ref[1] : void 0) || text);
this.comment = marked(text);
}
} catch (error) {
Expand Down
2 changes: 1 addition & 1 deletion spec/templates/classes/class_documentation.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a test class
# This is a test class with `inline.dot`. Beware.
#
# @note Please use
# this carefully
Expand Down
4 changes: 2 additions & 2 deletions spec/templates/classes/class_documentation.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
"Netzpirat",
"Plasticman"
],
"comment": "<p>This is a test class\n\n\n\n\n\n</p>\n",
"summary": "This is a test class"
"comment": "<p>This is a test class with <code>inline.dot</code>. Beware.\n\n\n\n\n\n</p>\n",
"summary": "This is a test class with `inline.dot`."
},
"class": {
"className": "TestClassDocumentation",
Expand Down
2 changes: 1 addition & 1 deletion src/nodes/doc.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = class Doc
comment.push line

text = comment.join('\n')
@summary = _.str.clean(/((?:.|\n)*?\.)/.exec(text)?[1] || text)
@summary = _.str.clean(/((?:.|\n)*?\.[\s$])/.exec(text)?[1] || text)
@comment = marked(text)

catch error
Expand Down

0 comments on commit 89f29f9

Please sign in to comment.