Skip to content

Commit

Permalink
Fix text disruption if it contains "invalid" urls
Browse files Browse the repository at this point in the history
fixes #186
  • Loading branch information
Trolldemorted committed Jul 9, 2018
1 parent 687621f commit fd80fea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Signal-Windows/Controls/Message.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,20 @@ private void UpdateMessageTextBlock()
}
catch (Exception)
{
MessageContentTextBlock.Inlines.Add(new Run()
{
Text = link
});
continue;
}
finally
{
previousIndex = currentIndex + match.Length;
currentIndex = previousIndex;
}
hyperlink.UnderlineStyle = UnderlineStyle.Single;
hyperlink.Inlines.Add(hyperlinkRun);
MessageContentTextBlock.Inlines.Add(hyperlink);
previousIndex = currentIndex + match.Length;
currentIndex = previousIndex;
}

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

0 comments on commit fd80fea

Please sign in to comment.