Don't break when we have a less than symbol in text

This commit is contained in:
rmgr 2022-04-06 17:06:50 +09:30
parent c68a4af4b1
commit 6d58810472
1 changed files with 3 additions and 2 deletions

View File

@ -130,6 +130,7 @@ def search_line_for_links(output_path, line, base_dir, page_title):
link_text = ""
found_tag = False
found_image = False
found_something = False
output = open(output_path, "a+")
for i in range(0, len(line)):
c = line[i]
@ -157,9 +158,9 @@ def search_line_for_links(output_path, line, base_dir, page_title):
if len(link_text) > 0:
process_tag(output, page_title, filename, base_dir, link_text)
elif c == "<":
found_link = True
for u in range(i + 1, len(line)):
if line[u] == ">":
found_link = True
process_external_link(output, link_text)
break
else:
@ -187,7 +188,7 @@ def search_line_for_links(output_path, line, base_dir, page_title):
found_link = False
elif found_image and line[i-1] in [")"]:
found_image = False
elif not found_link and not found_tag and not found_image:
if not found_link and not found_tag and not found_image:
output.write(c)
output.close()