sharp-chat/SharpChat.Common/Messages/IMessageExtensions.cs

10 lines
340 B
C#

namespace SharpChat.Messages {
public static class IMessageExtensions {
public static string GetSanitisedText(this IMessage msg)
=> msg.Text
.Replace(@"<", @"&lt;")
.Replace(@">", @"&gt;")
.Replace("\n", @" <br/> ")
.Replace("\t", @" ");
}
}