We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8702b27 commit 49e9a7cCopy full SHA for 49e9a7c
1 file changed
replace_links.py
@@ -22,21 +22,21 @@ def main():
22
23
# Pattern 1: HTML img tags with relative paths
24
content = re.sub(
25
- r'<img([^>]*?)src="(\.\.?/[^"]*)"',
+ r'<img([^>]*?)src="\.\.?/([^"]*)"',
26
f'<img\\1src="{base_url}\\2?raw=true"',
27
content
28
)
29
30
# Pattern 2: Markdown image syntax
31
32
- r'!\[([^\]]*?)\]\((\.\.?/[^)]*?)\)',
+ r'!\[([^\]]*?)\]\(\.\.?/([^)]*?)\)',
33
f'',
34
35
36
37
# Pattern 3: Markdown links to images
38
39
- r'\[([^\]]*?)\]\((\.\.?/[^)]*?\.(png|jpg|jpeg|gif|svg|webp))\)',
+ r'\[([^\]]*?)\]\(\.\.?/([^)]*?\.(png|jpg|jpeg|gif|svg|webp))\)',
40
f'[\\1]({base_url}\\2?raw=true)',
41
content,
42
flags=re.IGNORECASE
0 commit comments