fixed some stuff

This commit is contained in:
tdgmcode 2023-03-15 15:28:17 -04:00
parent d20e73e251
commit 227c045f87
3 changed files with 8 additions and 3 deletions

View file

@ -100,7 +100,12 @@ let formatPostText = function(post) {
let formatTypeStr = formats[formatType] || 'default';
if (post[i] === post[i] + '') {
newArr.push({'type': 'text', 'format': formatTypeStr, 'content': post[i]})
let lastEntry = (newArr.length > 0) ? newArr[newArr.length - 1] : {};
if (lastEntry.type == 'text' && lastEntry.format == formatTypeStr) {
newArr[newArr.length - 1].content += post[i];
} else {
newArr.push({'type': 'text', 'format': formatTypeStr, 'content': post[i]})
}
} else {
let content = post[i];
content.format = formatTypeStr;