incoming links for multiple wikilinks in a line

This commit is contained in:
sejo 2022-01-21 19:50:02 -06:00
parent 275898c511
commit e539d2a428
1 changed files with 4 additions and 3 deletions

View File

@ -32,13 +32,14 @@ for filename in os.listdir():
pre_mode = not pre_mode
if pre_mode: # skip preformatted mode
continue
m=re.search("\{[^{}]+\}",line)
if m:
match = m.group(0) # get matched string
while re.search("\{[^{}]+\}",line):
m = re.search("\{[^{}]+\}",line)
match = m.group() # matched string
if match not in incoming: # create a new set for that page
incoming[match] = set()
# add this file
incoming[match].add(wikilink)
line = line[m.end()+1:]
file.close()
os.chdir('../tmp/')