summaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorwebzwo0i <webzwo0i@c3d2.de>2013-12-08 11:37:07 +0100
committerwebzwo0i <webzwo0i@c3d2.de>2013-12-08 11:37:07 +0100
commit51769585a94fbc25f13a22fd52739112bd8f2970 (patch)
tree98b163036397be611d19d0887fcb2d45d6d115a8 /src/node
parent656a558af987c85e173a6e51f2ec11980ff24ec2 (diff)
downloadetherpad-lite-51769585a94fbc25f13a22fd52739112bd8f2970.zip
workaround so that at least one tag stays open if its the outermost tag. saves some space in the output
Diffstat (limited to 'src/node')
-rw-r--r--src/node/utils/ExportHtml.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/node/utils/ExportHtml.js b/src/node/utils/ExportHtml.js
index b445967e..2a614e99 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><s><u>em&strikethrough&underline</u>strikethrough&em</s></em><s>strikethrough</s>
+ // 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;