diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index b445967ec..2a614e993 100644
--- a/src/node/utils/ExportHtml.js
+++ b/src/node/utils/ExportHtml.js
@@ -306,18 +306,20 @@ function getHTMLFromAtext(pad, atext, authorColors)
tags2close.push(i);
propVals[i] = false;
}
- else if (propVals[i] === STAY)
+ else if (propVals[i] === STAY && openTags[openTags.length - 1] != i)
{
//emitCloseTag(i);
tags2close.push(i);
}
}
-
orderdCloseTags(tags2close);
-
+
+ // open all tags that are used in this op or got closed to satisfy order
+ // e.g. em&strikethrough&underlinestrikethrough&emstrikethrough
+ // TODO?: ensure the best ie shortest resolution
for (var i = 0; i < propVals.length; i++)
{
- if (propVals[i] === ENTER || propVals[i] === STAY)
+ if (propVals[i] === ENTER || (propVals[i] === STAY && openTags[openTags.length - 1] != i))
{
emitOpenTag(i);
propVals[i] = true;