Stop truncating lines with links

This commit is contained in:
rmgr 2022-06-09 09:37:19 +09:30
parent 3edbe684d7
commit 63b6f818ac
1 changed files with 4 additions and 2 deletions

View File

@ -126,6 +126,7 @@ def process_files(base_dir, files):
def search_line_for_links(output_path, line, base_dir, page_title):
found_link = False
link_offset = 0
filename = output_path.replace(base_dir, '')
link_text = ""
found_tag = False
@ -140,7 +141,8 @@ def search_line_for_links(output_path, line, base_dir, page_title):
for u in range(i + 2, len(line)):
if line[u-1] == "]" and line[u] == "]" :
process_link(output, link_text)
break
# link_offset = u + 1
break
else:
#We don't want markup in our links
@ -189,7 +191,7 @@ def search_line_for_links(output_path, line, base_dir, page_title):
elif found_link and c in ["<"]:
if line[i-1] in [ ">"]:
found_link = False
elif found_link and c == "[":
elif found_link and line[i-1] == "]":
if line[i-2] == "]":
found_link = False
elif found_image and line[i-1] in [")"]: