entity sort offset+length

This commit is contained in:
John Gibbon 2020-11-03 00:03:00 +01:00
parent 1b345a6654
commit 7240bbbf44

View file

@ -253,7 +253,7 @@ function enhanceMessageText(formattedText) {
}
}
messageInsertions.sort( function(a, b) { return b.offset - a.offset } );
messageInsertions.sort( function(a, b) { return (b.offset+b.removeLength) - (a.offset+a.removeLength) } );
for (var z = 0; z < messageInsertions.length; z++) {
messageText = messageText.substring(0, messageInsertions[z].offset) + messageInsertions[z].insertionString + messageText.substring(messageInsertions[z].offset + messageInsertions[z].removeLength);