Permalink
Browse files

Merge pull request #63 from Sannis/fix-events-names

Fix item name/prefix for events of nested sections/namespaces/classes
  • Loading branch information...
2 parents 570997c + 63f4d09 commit 87a0ce8c3a087abf348738af8ff2e379ddcd7465 @puzrin puzrin committed Jul 28, 2012
Showing with 17 additions and 2 deletions.
  1. +2 −2 lib/ndoc.js
  2. +15 −0 tests/features/issue_63.js
View
@@ -177,14 +177,14 @@ function build_tree(nodes, options) {
// cleanup nodes, reassign right ids after we resolved
// to which sections every element belongs
_.each(nodes, function (node, id) {
- var idx = node.id.indexOf('@'); // get position of @event start
-
delete nodes[id];
// compose new id
node.id = id.replace(/^[^.]*\./, '');
// First check for event, because event name can contain '.' and '#'
+ var idx = node.id.indexOf('@'); // get position of @event start
+
// Otherwise get property/method delimiter position
if (idx === -1) {
idx = Math.max(node.id.lastIndexOf('.'), node.id.lastIndexOf('#'));
View
@@ -0,0 +1,15 @@
+/**
+ * == Issue62 ==
+ **/
+
+/** section: Issue62
+ * class PullRequest
+ *
+ * This is a pull request that fixed "section > class > event" name parsing
+ **/
+
+/**
+ * PullRequest@event()
+ *
+ * Event example
+ **/

0 comments on commit 87a0ce8

Please sign in to comment.