mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Use common Overlaps()
logic
This actually fixes the problem and makes the tests pass
This commit is contained in:
parent
30bdd2d4c0
commit
d3517998cf
@ -85,8 +85,8 @@ namespace osu.Game.Online.Chat
|
||||
if (escapeChars != null)
|
||||
displayText = escapeChars.Aggregate(displayText, (current, c) => current.Replace($"\\{c}", c.ToString()));
|
||||
|
||||
// Check for encapsulated links
|
||||
if (result.Links.Find(l => (l.Index <= index && l.Index + l.Length >= index + m.Length) || (index <= l.Index && index + m.Length >= l.Index + l.Length)) == null)
|
||||
// Check for overlapping links
|
||||
if (!result.Links.Exists(l => l.Overlaps(index, m.Length)))
|
||||
{
|
||||
result.Text = result.Text.Remove(index, m.Length).Insert(index, displayText);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user