Skip to content
This repository was archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from zillow/recover-doc-error
Browse files Browse the repository at this point in the history
Recover from aberrant doc generation gracefully.
  • Loading branch information
rgrove committed Mar 15, 2012
2 parents f31e18c + de48550 commit c868974
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,25 @@ function onFetchSuccess(data) {

if (klass.methods) {
util.each(klass.methods, function (method, name) {
var match = name.match(/\.([^\.]+)$/);
var match, descr;

// catch a doc bug where description gets inserted in method name
if (name && name.indexOf('\n') > -1) {
descr = name.split('\n');
// clean method name
name = descr.shift().trim();
// append to existing description, if present
if (method.description) {
descr.unshift(method.description);
}
// augment methods object with clean copy of method config
klass.methods[name] = util.merge(method, {
description: descr.join('\n'),
name: name
});
}

match = name.match(/\.([^\.]+)$/);

name = match ? match[1].trim() : name.trim();

Expand Down

0 comments on commit c868974

Please sign in to comment.