From d71b11f4b2845f82018184ad0a2383d2147fcf8c Mon Sep 17 00:00:00 2001 From: webzwo0i Date: Sun, 28 Dec 2014 02:31:26 +0100 Subject: [PATCH] fix export of lists with bullets;
  • are closed before the next list starts. also, when closing, ensure that list-items are not nested --- src/node/utils/ExportHtml.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index 85d5e7a29..3e42b88b1 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -328,6 +328,9 @@ function getHTMLFromAtext(pad, atext, authorColors) if (whichList >= lists.length)//means we are on a deeper level of indentation than the previous line { + if(lists.length > 0){ + pieces.push('
  • ') + } lists.push([line.listLevel, line.listTypeName]); if(line.listTypeName == "number") { @@ -363,7 +366,7 @@ function getHTMLFromAtext(pad, atext, authorColors) pieces.push('

    '); } }*/ - else//means we are getting closer to the lowest level of indentation + else//means we are getting closer to the lowest level of indentation or are at the same level { while (whichList < lists.length - 1) { @@ -382,15 +385,23 @@ function getHTMLFromAtext(pad, atext, authorColors) } else//outside any list { + if(lists.length > 0){ + if(lists[lists.length - 1][1] == "number"){ + pieces.push(''); + } else { + pieces.push(''); + } + lists.length--; + } while (lists.length > 0)//if was in a list: close it before { if(lists[lists.length - 1][1] == "number") { - pieces.push(''); + pieces.push(''); } else { - pieces.push(''); + pieces.push(''); } lists.length--; }