From 47e20a2f4902447dc91961feb1d58a6516233960 Mon Sep 17 00:00:00 2001 From: ilmar Date: Thu, 3 May 2018 00:07:07 +0300 Subject: [PATCH] line parsing fix --- src/node/utils/ExportHtml.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js index e53c7a8d..f5caa8f6 100644 --- a/src/node/utils/ExportHtml.js +++ b/src/node/utils/ExportHtml.js @@ -369,7 +369,10 @@ function getHTMLFromAtext(pad, atext, authorColors) return (item.level === line.listLevel && item.type === line.listTypeName); }); if (!exists) { - var prevLevel = prevLine.listLevel || 0; + var prevLevel = 0; + if (prevLine && prevLine.listLevel) { + prevlevel = prevLine.listLevel; + } if (prevLine && line.listTypeName !== prevLine.listTypeName) { prevLevel = 0; @@ -405,7 +408,10 @@ function getHTMLFromAtext(pad, atext, authorColors) } if ((!nextLine || !nextLine.listLevel || nextLine.listLevel < line.listLevel) || (nextLine && line.listTypeName !== nextLine.listTypeName)) { - var nextLevel = nextLine.listLevel || 0; + var nextLevel = 0; + if (nextLine && nextLine.listLevel) { + nextLevel = nextLine.listLevel; + } if (nextLine && line.listTypeName !== nextLine.listTypeName) { nextLevel = 0;