forked from kenkeiras/org-rw
Revert "Fix parsing of lists inside drawers."
This reverts commit 5e4a9f8ff2
.
The tree should not be modified, as it's the returned value. We need an
additional tree for parent-child element connections.
This commit is contained in:
parent
5e4a9f8ff2
commit
d1d5de89b7
@ -489,26 +489,15 @@ class Headline:
|
|||||||
elif content.strip().upper() == ":END:":
|
elif content.strip().upper() == ":END:":
|
||||||
if current_node is None:
|
if current_node is None:
|
||||||
logging.warning('Finished node (:END:) with no known starter')
|
logging.warning('Finished node (:END:) with no known starter')
|
||||||
else:
|
elif not (isinstance(
|
||||||
tree_up = list(tree)
|
current_node, dom.PropertyDrawerNode
|
||||||
while len(tree_up) > 0:
|
) or isinstance(
|
||||||
node = tree_up[-1]
|
current_node, dom.LogbookDrawerNode
|
||||||
if (isinstance(
|
) or isinstance(
|
||||||
node, dom.PropertyDrawerNode
|
current_node, dom.ResultsDrawerNode
|
||||||
) or isinstance(
|
)):
|
||||||
node, dom.LogbookDrawerNode
|
raise Exception('Unexpected node: {}'.format(current_node))
|
||||||
) or isinstance(
|
current_node = None
|
||||||
node, dom.ResultsDrawerNode
|
|
||||||
)):
|
|
||||||
tree = tree_up
|
|
||||||
current_node = node
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
tree_up.pop(-1)
|
|
||||||
else:
|
|
||||||
raise Exception('Unexpected node ({}) on headline (id={}), line {}'.format(current_node, self.id, linenum))
|
|
||||||
current_node = None
|
|
||||||
tree.pop()
|
|
||||||
elif content.strip().upper() == ":RESULTS:":
|
elif content.strip().upper() == ":RESULTS:":
|
||||||
assert current_node is None
|
assert current_node is None
|
||||||
current_node = dom.ResultsDrawerNode()
|
current_node = dom.ResultsDrawerNode()
|
||||||
|
Loading…
Reference in New Issue
Block a user