diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index 7f4874a8d..13140bb58 100644
--- a/src/node/utils/ExportHtml.js
+++ b/src/node/utils/ExportHtml.js
@@ -356,7 +356,15 @@ function getHTMLFromAtext(pad, atext, authorColors)
}
}
}
-
+ var context = {
+ line: line,
+ lineContent: lineContent,
+ apool: apool,
+ attribLine: attribLines[i],
+ text: textLines[i],
+ padId: pad.id
+ }
+ var lineContentFromHook = hooks.callAll("getLineHTMLForExport", context);
if (whichList >= lists.length)//means we are on a deeper level of indentation than the previous line
{
if(lists.length > 0){
@@ -373,14 +381,14 @@ function getHTMLFromAtext(pad, atext, authorColors)
if(toOpen > 0){
pieces.push(new Array(toOpen + 1).join('
'))
}
- pieces.push('- ', lineContent || '
');
+ pieces.push('- ', context.lineContent || '
');
}
else
{
if(toOpen > 0){
pieces.push(new Array(toOpen + 1).join(''))
}
- pieces.push('- ', lineContent || '
');
+ pieces.push('- ', context.lineContent || '
');
}
}
//the following code *seems* dead after my patch.
@@ -416,16 +424,16 @@ function getHTMLFromAtext(pad, atext, authorColors)
if(lists[lists.length - 1][1] == "number")
{
pieces.push(new Array(toClose+1).join('
'))
- pieces.push(' - ', lineContent || '
');
+ pieces.push(' - ', context.lineContent || '
');
}
else
{
pieces.push(new Array(toClose+1).join(''))
- pieces.push(' - ', lineContent || '
');
+ pieces.push(' - ', context.lineContent || '
');
}
lists = lists.slice(0,whichList+1)
} else {
- pieces.push(' - ', lineContent || '
');
+ pieces.push(' - ', context.lineContent || '
');
}
}
}
@@ -451,22 +459,9 @@ function getHTMLFromAtext(pad, atext, authorColors)
padId: pad.id
}
- var lineContentFromHook = hooks.callAllStr("getLineHTMLForExport", context, " ", " ", "");
+ hooks.callAll("getLineHTMLForExport", context);
- if (lineContentFromHook)
- {
- var lcToTestTrue = lineContentFromHook;
- lcToTestTrue = lcToTestTrue.replace(/true/g, '').replace(/ /g, '');
- if (context.lineContent === lineContent && lcToTestTrue.length) { // Just to be compatible with plugins that are not updated to this solution
- pieces.push(lineContentFromHook, '');
- } else {
- pieces.push(context.lineContent, ''); // should be used instead of lineContentFromHook because context is passed through each hook with all it's updated from each plugin
- }
- }
- else
- {
- pieces.push(lineContent, '
');
- }
+ pieces.push(context.lineContent, '
');
}
}