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

11 lines
340 B
C#
Raw Permalink Normal View History

2022-08-30 15:05:29 +00:00
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", @" ");
}
}