Small tweak to expand results

This commit is contained in:
Oly 2018-10-31 17:06:25 +00:00
parent 818856a585
commit 84ae1933a1
1 changed files with 9 additions and 10 deletions

View File

@ -190,18 +190,17 @@ def parse(stream):
for line in stream: for line in stream:
line = line.strip('\n') line = line.strip('\n')
if block is not False: if block is not False:
result = parsebody(line, block) block, token = parsebody(line, block)
if result: if token:
block = result[0] #block = result[0]
doc.update(result[1]) doc.update(token)
continue continue
result = parseline(line) block, token = parseline(line)
if result: if token:
block = result[0] if doc.token() == "TEXT" and token.token == "TEXT":
if doc.token() == "TEXT" and result[1].token == "TEXT": doc.update(token.value)
doc.update(result[1].value)
continue continue
doc.append(result[1]) doc.append(token)
for item in doc.filter('TEXT'): for item in doc.filter('TEXT'):
item.value = parse_text(item.value) item.value = parse_text(item.value)