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
urlstringThe raw URL to escape. May be
nullor empty.
Returns
Unescape(string)
Reverses Escape(string). Decodes each %XX hex pair; a malformed tail is left literal.
public static string Unescape(string escaped)
Parameters
escapedstringThe escaped string produced by Escape(string). May be
nullor empty.