6
Vote

AntiXss.GetSafeHtmlFragment() removes newline characters from text

description

AntiXss.GetSafeHtmlFragment() removes newline characters from text between tags

comments

Sethinon wrote Feb 8, 2011 at 10:01 PM

The following workaround did the trick for me:

AntiXss.GetSafeHtmlFragment(strMessage.Replace(ControlChars.Lf.ToString(), "<br>")).Replace("<br>", "")

Where strMessage is the string with newlines you're calling AntiXss on.