Skip to content

Commit 3f1bb3b

Browse files
committed
fix regex to be non-greedy
1 parent 6b54340 commit 3f1bb3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def remove_url_accents(text : str) -> str:
4444
Cause the headings get the id without the accents
4545
'''
4646

47-
pattern = r'\[(.*)\]\((.*)\)'
47+
pattern = r'\[(.*)\]\((.*?)\)'
4848
return re.sub(pattern, lambda m: f'[{m.group(1)}]({unidecode(m.group(2))})', text)
4949

5050

0 commit comments

Comments
 (0)