i = find_token2(lines, token, start, end)
if i == -1:
return ""
- return string.split(lines[i])[1]
+ if len(string.split(lines[i])) > 1:
+ return string.split(lines[i])[1]
+ else:
+ return ""
def del_token(lines, token, i, j):
k = find_token2(lines, token, i, j)
# Finds the matching \end_inset
def find_beginning_of(lines, i, start_token, end_token):
count = 1
- n = len(lines)
- while i < n:
+ while i > 0:
i = find_tokens_backwards(lines, [start_token, end_token], i-1)
if check_token(lines[i], end_token):
count = count+1