Compartilhar via


SPHttpUtility.HtmlEncodeAllowSimpleTextFormatting Method

Include Protected Members
Include Inherited Members

Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting.

Overload List

  Name Description
Public methodStatic member HtmlEncodeAllowSimpleTextFormatting(String) Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting.
Public methodStatic member HtmlEncodeAllowSimpleTextFormatting(String, TextWriter) Encodes the specified string for use as text between HTML tags, preserving spaces in the original string and allowing simple text formatting, and appends it to the specified output stream.

Top

Remarks

The HtmlEncodeAllowSimpleTextFormatting method:

  • Replaces ampersand, double-quotation, single-quotation, less-than, and greater-than characters with the appropriate entity references.

  • Replaces space characters preceded by a newline character or followed by another space character with " " entity references.

  • Replaces newline characters with HTML "<br>" tags.

  • Replaces carriage-return characters with space characters.

"<br>", "<b>", "<i>", "<u>", "</b>", "</i>", and "</u>" HTML tags and " " entity references in the specified string are permitted and not encoded. The allowed HTML tags and entity reference are case sensitive.

See Also

Reference

SPHttpUtility Class

SPHttpUtility Members

Microsoft.SharePoint.Utilities Namespace