Markdown.Decode Method

Namespace
Kampute.DocToolkit.Support
Assembly
  • Kampute.DocToolkit.dll
Decode(string)Decodes escaped Markdown special characters in the given text.
Decode(ReadOnlySpan<char>, TextWriter)Decodes escaped Markdown special characters in the given text and writes the result to the specified TextWriter.

Decode(string)

Decodes escaped Markdown special characters in the given text.
public static string Decode(string text)

Parameters

text string
The text to decode.

Returns

string
A string with escaped Markdown special characters restored to their original form.

Exceptions

ArgumentNullException
Thrown when text is null.

Remarks

Only a backslash followed by an ASCII punctuation character is an escape. A backslash followed by any other character, or at the end of the text, is kept as a literal backslash.

Decode(ReadOnlySpan<char>, TextWriter)

Decodes escaped Markdown special characters in the given text and writes the result to the specified TextWriter.
public static void Decode(ReadOnlySpan<char> text, TextWriter output)

Parameters

text ReadOnlySpan<char>
The text to decode.
output TextWriter
The TextWriter to write the decoded text to.

Exceptions

ArgumentNullException
Thrown when output is null.

Remarks

Only a backslash followed by an ASCII punctuation character is an escape. A backslash followed by any other character, or at the end of the text, is kept as a literal backslash.