Fix newline rendering in embeds on iOS

This commit is contained in:
Ske
2020-02-20 22:57:37 +01:00
parent 456fe8f7af
commit de141d629b
4 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Security.Cryptography;
using System.Text.RegularExpressions;
namespace PluralKit.Core
{
@@ -60,5 +61,12 @@ namespace PluralKit.Core
if (input.Trim().Length == 0) return true;
return false;
}
public static string NormalizeLineEndSpacing(this string input)
{
// iOS has a weird issue on embeds rendering newlines when there are spaces *just before* it
// so we remove 'em all :)
return Regex.Replace(input, " *\n", "\n");
}
}
}