From 05d0e9e6a3ae7ed293ea46d0e978eb35a2b5107f Mon Sep 17 00:00:00 2001 From: firedfox Date: Thu, 31 Mar 2016 11:55:59 +0800 Subject: [PATCH] tools,doc: fix incomplete json produced by doctool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Robert Lindstädt Reviewed-By: Roman Reiss --- tools/doc/json.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/doc/json.js b/tools/doc/json.js index a80c7efb1f43cc..b2165c15d23c90 100644 --- a/tools/doc/json.js +++ b/tools/doc/json.js @@ -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;