Skip to content

Hypertext Markup Language

Taiizor edited this page Mar 1, 2023 · 2 revisions

The HtmlExtension class provides extension methods for encoding, decoding, minifying, and beautifying HTML strings.

Namespace

Skylark.Standard.Extension.Html

Methods

public static string Encode(string Html = MHHM.Html)

Encodes an HTML string using the JavaScript unescape() function.

Parameters

  • Html (optional): The HTML string to encode. The default value is MHHM.Html, which is an empty string.

Returns

The encoded HTML string.

Exceptions

  • E: If an exception occurs during encoding, the original exception is rethrown wrapped in a new E exception.

public static Task<string> EncodeAsync(string Html = MHHM.Html)

Encodes an HTML string asynchronously using the JavaScript unescape() function.

Parameters

  • Html (optional): The HTML string to encode. The default value is MHHM.Html, which is an empty string.

Returns

A Task<string> that represents the encoded HTML string.

Exceptions

  • E: If an exception occurs during encoding, the original exception is rethrown wrapped in a new E exception.

public static string Decode(string Html = MHHM.Html)

Decodes an HTML string that was encoded using the Encode() method.

Parameters

  • Html (optional): The HTML string to decode. The default value is MHHM.Html, which is an empty string.

Returns

The decoded HTML string.

Exceptions

  • E: If an exception occurs during decoding, the original exception is rethrown wrapped in a new E exception.

public static Task<string> DecodeAsync(string Html = MHHM.Html)

Decodes an HTML string asynchronously that was encoded using the Encode() method.

Parameters

  • Html (optional): The HTML string to decode. The default value is MHHM.Html, which is an empty string.

Returns

A Task<string> that represents the decoded HTML string.

Exceptions

  • E: If an exception occurs during decoding, the original exception is rethrown wrapped in a new E exception.

Clone this wiki locally