tools,doc: fix incomplete json produced by doctool
authorfiredfox <wangyang0123@gmail.com>
Thu, 31 Mar 2016 03:55:59 +0000 (11:55 +0800)
committerMyles Borins <mborins@us.ibm.com>
Mon, 11 Apr 2016 16:12:05 +0000 (12:12 -0400)
Doc tool produces incomplete json when it meets unordered lists that
directly following a heading. Add a default case to processList function
to handle the lists.

PR-URL: https://github.com/nodejs/node/pull/5966
Fixes: https://github.com/nodejs/node/issues/1545
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Lindstädt <robert.lindstaedt@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
tools/doc/json.js

index a80c7ef..b2165c1 100644 (file)
@@ -260,6 +260,14 @@ function processList(section) {
       // event: each item is an argument.
       section.params = values;
       break;
+
+    default:
+      if (section.list.length > 0) {
+        section.desc = section.desc || [];
+        for (var i = 0; i < section.list.length; i++) {
+          section.desc.push(section.list[i]);
+        }
+      }
   }
 
   // section.listParsed = values;