mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Fix Tags extraction in Org Node parser
- Previous version required two tags at least to work, not sure why - Fixed it to extract all tags, even if only one tag in heading
This commit is contained in:
@@ -83,15 +83,13 @@ def makelist(filename):
|
|||||||
bodytext = ""
|
bodytext = ""
|
||||||
tag1 = ""
|
tag1 = ""
|
||||||
alltags = [] # list of all tags in headline
|
alltags = [] # list of all tags in headline
|
||||||
tagsrch = re.search(r'(.*?)\s*:([a-zA-Z0-9].*?):([a-zA-Z0-9].*?):$',heading)
|
tagsrch = re.search(r'(.*?)\s*:([a-zA-Z0-9].*?):$',heading)
|
||||||
if tagsrch:
|
if tagsrch:
|
||||||
heading = tagsrch.group(1)
|
heading = tagsrch.group(1)
|
||||||
tag1 = tagsrch.group(2)
|
tags = tagsrch.group(2)
|
||||||
alltags.append(tag1)
|
if tags:
|
||||||
tag2 = tagsrch.group(3)
|
for tag in tags.split(':'):
|
||||||
if tag2:
|
if tag != '': alltags.append(tag)
|
||||||
for t in tag2.split(':'):
|
|
||||||
if t != '': alltags.append(t)
|
|
||||||
else: # we are processing a non-heading line
|
else: # we are processing a non-heading line
|
||||||
if line[:10] == '#+SEQ_TODO':
|
if line[:10] == '#+SEQ_TODO':
|
||||||
kwlist = re.findall(r'([A-Z]+)\(', line)
|
kwlist = re.findall(r'([A-Z]+)\(', line)
|
||||||
|
|||||||
Reference in New Issue
Block a user