Skip to content

Commit 0b66d1c

Browse files
committed
fix: encode bracket that appears in wikipedia links
1 parent 0b777a2 commit 0b66d1c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/utils/markdown.py

+10
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ def convert_sub(self, el, text, convert_as_inline):
4444
def convert_sup(self, el, text, convert_as_inline):
4545
return f'^{text}'
4646

47+
def convert_a(self, el, text, convert_as_inline):
48+
el['href'] = re.sub(r'\(', '%28', el['href'])
49+
el['href'] = re.sub(r'\)', '%29', el['href'])
50+
return MarkdownConverter.convert_a(
51+
self=self,
52+
el=el,
53+
text=text,
54+
convert_as_inline=convert_as_inline
55+
)
56+
4757
def generate(html, **options):
4858
"""Convert function with options predefined"""
4959

0 commit comments

Comments
 (0)