Table of Contents

Class LinkUrl

Namespace
SharpConsoleUI.Parsing
Assembly
SharpConsoleUI.dll

Percent-escapes a URL so it can safely live inside a [link=…] markup tag, and reverses that escaping. The markup parser reads a tag by scanning to the next ], so the escaped form must contain no literal ]. % is encoded, making Escape(string)/Unescape(string) exact inverses.

public static class LinkUrl
Inheritance
LinkUrl
Inherited Members

Methods

Escape(string)

Percent-encodes % [ ] space and control chars (< 0x20). A URL with none passes through unchanged.

public static string Escape(string url)

Parameters

url string

The raw URL to escape. May be null or empty.

Returns

string

The escaped URL containing no literal ]. Returns Empty for a null or empty input.

Unescape(string)

Reverses Escape(string). Decodes each %XX hex pair; a malformed tail is left literal.

public static string Unescape(string escaped)

Parameters

escaped string

The escaped string produced by Escape(string). May be null or empty.

Returns

string

The decoded URL. Returns Empty for a null or empty input.