mirror of
https://github.com/public-apis/public-apis.git
synced 2025-06-04 11:51:50 +02:00
Get content from index 0 if Index section does not exist
This commit is contained in:
parent
ae7ac00586
commit
f3146c9e24
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue