workaround so that at least one tag stays open if its the outermost tag. saves some space in the output
This commit is contained in:
parent
656a558af9
commit
51769585a9
1 changed files with 6 additions and 4 deletions
|
@ -306,18 +306,20 @@ function getHTMLFromAtext(pad, atext, authorColors)
|
||||||
tags2close.push(i);
|
tags2close.push(i);
|
||||||
propVals[i] = false;
|
propVals[i] = false;
|
||||||
}
|
}
|
||||||
else if (propVals[i] === STAY)
|
else if (propVals[i] === STAY && openTags[openTags.length - 1] != i)
|
||||||
{
|
{
|
||||||
//emitCloseTag(i);
|
//emitCloseTag(i);
|
||||||
tags2close.push(i);
|
tags2close.push(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
orderdCloseTags(tags2close);
|
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++)
|
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);
|
emitOpenTag(i);
|
||||||
propVals[i] = true;
|
propVals[i] = true;
|
||||||
|
|
Loading…
Reference in a new issue