301} else if (currentItem.myHref === '' && hasButtonWithSpace === ' button=') {302currentItem.myText = currentItem.myText.slice(0, -8);303currentItem.myHrefType = 'btn';304}305currentItem.myHref += data[i];306} else {307currentItem.myText += data[i];308hasLink = t431__checkSubstr('link=', hasLink, data[i]);309hasLinkWithSpace = t431__checkSubstr(' link=', hasLinkWithSpace, data[i]);310hasButton = t431__checkSubstr('button=', hasButton, data[i]);311hasButtonWithSpace = t431__checkSubstr(' button=', hasButtonWithSpace, data[i]);
} endLine = t431__checkSubstr('<br />', endLine, data[i]); if (endLine == '<br />') { if (currentItem.myHref) { currentItem.myHref = currentItem.myHref.slice(0, -6); } else { currentItem.myText = currentItem.myText.slice(0, -6); } arrayRow.push(currentItem); arrayTable.push(arrayRow); currentItem = { myText: '', myHref: '', }; hasLink = ''; hasLinkWithSpace = ''; hasButton = ''; hasButtonWithSpace = ''; arrayRow = []; } } } if (arrayRow.length > 0 || currentItem.myText !== '') { if (currentItem !== '') { arrayRow.push(currentItem); } arrayTable.push(arrayRow); } } return arrayTable;}/* checking a step by step combining of t431__targetSubstr*/function t431__checkSubstr(targetSubstr, currentSubstr, curSymbol) { if (!currentSubstr && curSymbol == targetSubstr[0]) { return curSymbol; } else if (currentSubstr) { for (var i = 0; i < targetSubstr.length - 1; i++) { if (currentSubstr[currentSubstr.length - 1] == targetSubstr[i] && curSymbol == targetSubstr[i + 1]) { return (currentSubstr += curSymbol); } } }}function t431__addBrTag(oldStringItem) { var newStringItem = ''; if (oldStringItem) { for (var i = 0; i < oldStringItem.length; i++) { if (oldStringItem[i] == '\n' || oldStringItem[i] == '\r') { newStringItem += '<br />'; } else { newStringItem += oldStringItem[i]; } } } return newStringItem.replace(/ /g, ' ');}