File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -636,7 +636,9 @@ def _parse_comments(self):
636
636
for todokey in ['TODO' , 'SEQ_TODO' , 'TYP_TODO' ]:
637
637
for val in special_comments .get (todokey , []):
638
638
self .env .add_todo_keys (* parse_seq_todo (val ))
639
-
639
+ # parse TITLE keys and store in title
640
+ if 'TITLE' in special_comments :
641
+ self .title = special_comments ['TITLE' ][0 ]
640
642
# misc
641
643
642
644
@property
Original file line number Diff line number Diff line change @@ -82,3 +82,18 @@ def test_add_custom_todo_keys():
82
82
root = loads (content , filename , env )
83
83
assert root .env .all_todo_keys == ['CUSTOM_TODO' , 'COMMENT_TODO' ,
84
84
'CUSTOM_DONE' , 'COMMENT_DONE' ]
85
+
86
+ def test_add_custom_todo_keys ():
87
+ filename = '<string>' # default for loads
88
+ content = """#+TITLE: Test title
89
+ * Node 1
90
+ test 1
91
+ * Node 2
92
+ test 2
93
+ """
94
+
95
+ env = OrgEnv (filename = filename )
96
+
97
+ # after parsing, all keys are set
98
+ root = loads (content , filename , env )
99
+ assert root .title == 'Test title'
You can’t perform that action at this time.
0 commit comments