mirror of
https://github.com/espressif/esp-idf
synced 2025-03-12 10:39:11 -04:00
docs: fix link_roles not linking correctly for certain files
Link_roles could link incorrectly if the name of a file matched the name of a submodule
This commit is contained in:
parent
ee126bc154
commit
35c3a51c17
@ -57,7 +57,8 @@ def github_link(link_type, idf_rev, submods, root_path, app_config):
|
||||
# Redirects to submodule repo if path is a submodule, else default to IDF repo
|
||||
def redirect_submodule(path, submods, rev):
|
||||
for key, value in submods.items():
|
||||
if path.lstrip('/').startswith(key):
|
||||
# Add path separator to end of submodule path to ensure we are matching a directory
|
||||
if path.lstrip('/').startswith(os.path.join(key, '')):
|
||||
return value.url.replace('.git', ''), value.rev, re.sub('^/{}/'.format(key), '', path)
|
||||
|
||||
return IDF_REPO, rev, path
|
||||
|
Loading…
x
Reference in New Issue
Block a user