Skip to content

Commit fd80fea

Browse files
committed
Fix text disruption if it contains "invalid" urls
fixes #186
1 parent 687621f commit fd80fea

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Signal-Windows/Controls/Message.xaml.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,20 @@ private void UpdateMessageTextBlock()
167167
}
168168
catch (Exception)
169169
{
170+
MessageContentTextBlock.Inlines.Add(new Run()
171+
{
172+
Text = link
173+
});
170174
continue;
171175
}
176+
finally
177+
{
178+
previousIndex = currentIndex + match.Length;
179+
currentIndex = previousIndex;
180+
}
172181
hyperlink.UnderlineStyle = UnderlineStyle.Single;
173182
hyperlink.Inlines.Add(hyperlinkRun);
174183
MessageContentTextBlock.Inlines.Add(hyperlink);
175-
previousIndex = currentIndex + match.Length;
176-
currentIndex = previousIndex;
177184
}
178185

179186
// Then finish up by adding the rest of the message text to the TextBox

0 commit comments

Comments
 (0)