diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index bd0ad12c..50ebd8b6 100644
--- a/src/node/utils/ExportHtml.js
+++ b/src/node/utils/ExportHtml.js
@@ -360,7 +360,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
{
nextLine = _analyzeLine(textLines[i + 1], attribLines[i + 1], apool);
}
- hooks.callAll('getLineHTMLForExport', context);
+ hooks.aCallAll('getLineHTMLForExport', context);
//To create list parent elements
if ((!prevLine || prevLine.listLevel !== line.listLevel) || (prevLine && line.listTypeName !== prevLine.listTypeName))
{
@@ -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;
@@ -445,7 +451,7 @@ function getHTMLFromAtext(pad, atext, authorColors)
padId: pad.id
};
- hooks.callAll("getLineHTMLForExport", context);
+ hooks.aCallAll("getLineHTMLForExport", context);
pieces.push(context.lineContent, "
");
}
}
@@ -556,4 +562,4 @@ function _processSpaces(s){
}
}
return parts.join('');
-}
\ No newline at end of file
+}