_binary From 710ad745e12829597d42e7876b3397ebcd1b017d Mon Sep 17 00:00:00 2001
From: epinapala <epinapala@ebay.com>
Date: Mon, 15 Dec 2014 13:34:36 -0800
Subject: [PATCH] - Regex changes to honor double newline characters for
 parsing lists.

---
 scripts/help.js | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/scripts/help.js b/scripts/help.js
index fc8ce05..0d90a83 100644
--- a/scripts/help.js
+++ b/scripts/help.js
@@ -231,14 +231,17 @@ function parseWikiContent(wiki_text, group_id, page_id, controller_name,
  */
 function parseLists(str)
 {
-    return str.replace(/(?:(?:(?:^|\n)[\*#].*)+)/g, function (match)
-    {
-        var listType = match.match(/(^|\n)#/) ? 'ol' : 'ul';
-        match = match.replace(/(^|\n)[\*#][ ]{0,1}/g, "$1");
+    return str.replace(/(?:(?:(?:^|\n)[\*#](?:.+\n)+.*))/g, function(match){
+        match = match.replace(/\n(?![#\*])/g," ");
+        var listType = match.match(/(^|\s)#/) ? 'ol' : 'ul';
+        match = match.replace(/(^|\s)[\*#][ ]{0,1}/g, "$1");
         match = parseLists(match);
-        return '<' + listType + '><li>' + match.replace(/^\n/, '')
-            .split(/\n/).join('</li><li>') + '</li></' + listType +
-        '>';
+        return '<'
+            + listType + '><li>'
+            + match.replace(/^\s/, '')
+                .split(/\n/).join('</li><li>')
+            + '</li></' + listType
+            + '>';
     });
 }
 /*
-- 
2.1.2

