When a user create a message there is a multibox and this multibox is connected to a design panel which lets users change fonts, color, size etc.. When the message is submited the message will be displayed with html tags if the user have changed color, size etc on the font.
Note: I need the design panel, I know its possible to remove it but this is not the case :)
Which means that all html tags should be stripped except
Its also important that the attributes inside the the
<img> tag that wont be removed. It could be isplayed like this:
<img src="/image/Penguins.jpg" alt="Penguins.jpg" style="margin:5px;width:331px;">
I used to use this following codebehind C# code which worked perfectly but it would strip all html tags except
<br> tag only.
public string Strip(string text)
return Regex.Replace(text, @"<(?!br[x20/>])[^<>]+>", string.Empty);
Any kind of help is appreciated alot
See Question&Answers more detail:os