i = 0
Первый проход. Поиск "странных" переносов
for item in old_List:
, ,s = item.strip()# Обрезание пробелов
, ,if s == '':
, , , ,new_List.append(s)
, , , ,i += 1
, , , ,if i > len(old_List):
, , , , , ,new_List.append(item[i+1])
, , , , , ,break
, , , ,continue
, ,
, ,if (s[-1] == '-'): # последний символ строки
, , , ,SQ = EndStr(s) # следующая строка начинается с SQ
, , , ,if (SQ != None) and (SQ != '') and (old_List[i+1].find(SQ)==0):
, , , , , ,m = -(len(SQ)+1)
, , , , , ,new_List.append(s[:m]+'@') # помечаем строку для последующего объединения
, , , ,else:
, , , , , ,new_List.append(s)
, ,else:
, , , ,new_List.append(s)
, ,i += 1
, ,if i > len(old_List):
, , , ,new_List.append(item[i+1])
, , , ,break
old_List.clear()