HtmlExtensions.HtmlSafe Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

HtmlSafe(string, bool)

Converts ampersands (&), left angle brackets (<), right angle brackets (>) and optionally line breaks (\n) to equivalent character entities.

public static string HtmlSafe(this string text, bool br = false)

Parameters

text
string

The text to convert.

br
bool

When true converts line breaks to <br />

Returns

string

The converted text.