Get content from index 0 if Index section does not exist

This commit is contained in:
Matheus Felipe
2022-01-15 19:24:35 -03:00
parent ae7ac00586
commit f3146c9e24

View File

@@ -29,6 +29,8 @@ def find_links_in_file(filename: str) -> List[str]:
with open(filename, mode='r', encoding='utf-8') as file:
readme = file.read()
index_section = readme.find('## Index')
if index_section == -1:
index_section = 0
content = readme[index_section:]
links = find_links_in_text(content)