Browse Source

Get content from index 0 if Index section does not exist

pull/3011/head
Matheus Felipe 2 years ago
parent
commit
f3146c9e24
No known key found for this signature in database GPG Key ID: AA785C523274872F
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      scripts/validate/links.py

+ 2
- 0
scripts/validate/links.py 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: 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)


Loading…
Cancel
Save