mirror of
https://github.com/FranP-code/public-apis.git
synced 2025-10-13 00:03:04 +00:00
Get content from index 0 if Index section does not exist
This commit is contained in:
@@ -29,6 +29,8 @@ def find_links_in_file(filename: str) -> List[str]:
|
|||||||
with open(filename, mode='r', encoding='utf-8') as file:
|
with open(filename, mode='r', encoding='utf-8') as file:
|
||||||
readme = file.read()
|
readme = file.read()
|
||||||
index_section = readme.find('## Index')
|
index_section = readme.find('## Index')
|
||||||
|
if index_section == -1:
|
||||||
|
index_section = 0
|
||||||
content = readme[index_section:]
|
content = readme[index_section:]
|
||||||
|
|
||||||
links = find_links_in_text(content)
|
links = find_links_in_text(content)
|
||||||
|
|||||||
Reference in New Issue
Block a user