Fix issue when source_suffix equals source_link_suffix (#29)
This commit is contained in:
@@ -90,7 +90,13 @@ class DocumentCollector:
|
||||
|
||||
# Try to find the source file with any of the valid source suffixes
|
||||
for src_suffix in source_suffixes:
|
||||
candidate_file = sources_dir / f"{docname}{src_suffix}{source_link_suffix}"
|
||||
# Avoid duplicate extensions when source_suffix == source_link_suffix
|
||||
if src_suffix == source_link_suffix:
|
||||
candidate_file = sources_dir / f"{docname}{src_suffix}"
|
||||
else:
|
||||
candidate_file = (
|
||||
sources_dir / f"{docname}{src_suffix}{source_link_suffix}"
|
||||
)
|
||||
if candidate_file.exists():
|
||||
return src_suffix
|
||||
|
||||
|
||||
Reference in New Issue
Block a user