Skip to content

Commit aa65d10

Browse files
committed
Fix link label styling regex to handle missing style attribute
1 parent 885d22b commit aa65d10

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/LunaTranslator/gui/usefulwidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3610,7 +3610,7 @@ def setText(self, t):
36103610
self.palette().color(QPalette.ColorRole.Text),
36113611
).name()
36123612
t = re.sub(
3613-
'<a(.*?)style=".*?"(.*?)>', '<a\\1\\2 style="color: {};">'.format(color1), t
3613+
'<a(.*?)(style=".*?")?(.*?)>', '<a\\1\\3 style="color: {};">'.format(color1), t
36143614
)
36153615
super().setText(t)
36163616

0 commit comments

Comments
 (0)