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 9: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.

wrote Jul 6, 2011 at 4:58 AM

wrote Jul 6, 2011 at 2:39 PM

wrote Nov 17, 2011 at 5:11 PM

wrote Jan 28, 2012 at 5:13 PM

wrote Feb 22, 2013 at 12:07 AM