From 84ae1933a1d75841e9e5bd02956aa83102c91462 Mon Sep 17 00:00:00 2001 From: Oly Date: Wed, 31 Oct 2018 17:06:25 +0000 Subject: [PATCH] Small tweak to expand results --- eorg/parser.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/eorg/parser.py b/eorg/parser.py index 3574e19..565fe2d 100644 --- a/eorg/parser.py +++ b/eorg/parser.py @@ -190,18 +190,17 @@ def parse(stream): for line in stream: line = line.strip('\n') if block is not False: - result = parsebody(line, block) - if result: - block = result[0] - doc.update(result[1]) + block, token = parsebody(line, block) + if token: + #block = result[0] + doc.update(token) continue - result = parseline(line) - if result: - block = result[0] - if doc.token() == "TEXT" and result[1].token == "TEXT": - doc.update(result[1].value) + block, token = parseline(line) + if token: + if doc.token() == "TEXT" and token.token == "TEXT": + doc.update(token.value) continue - doc.append(result[1]) + doc.append(token) for item in doc.filter('TEXT'): item.value = parse_text(item.value)