Skip to content

Commit bd8d19f

Browse files
authored
fix issues (#123)
Co-authored-by: itachi sasuke <[email protected]>
1 parent 06c68c1 commit bd8d19f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/merge_docs_configs.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -857,13 +857,20 @@ def replace_markdown(match):
857857
text = match.group(1)
858858
path = match.group(2)
859859

860+
# Strip leading/trailing whitespace from path
861+
path_stripped = path.strip()
862+
860863
# Skip external links and mailto (including angle bracket wrapped)
861-
if (path.startswith('http') or path.startswith('//') or
862-
path.startswith('<mailto:') or 'mailto:' in path):
864+
if (path_stripped.startswith('http') or path_stripped.startswith('//') or
865+
path_stripped.startswith('<mailto:') or 'mailto:' in path_stripped):
866+
return match.group(0)
867+
868+
# Only process actual internal links that start with /
869+
if not path_stripped.startswith('/'):
863870
return match.group(0)
864871

865872
changes_made += 1
866-
return f'[{text}]({prefix}{path})'
873+
return f'[{text}]({prefix}{path_stripped})'
867874

868875
content = re.sub(r'\[([^\]]+)\]\((/[^)]*)\)', replace_markdown, content)
869876

0 commit comments

Comments
 (0)