Class MarkdownExtensions
Markdown-related extension methods for
Inheritance
Namespace: X10D.Text
Assembly: X10D.dll
Syntax
public static class MarkdownExtensions : object
Methods
| Improve this Doc View SourceMDBold(String)
Formats the specified text as bold, using Markdown.
Declaration
public static string MDBold(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with bold. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDCode(String)
Formats the specified text as code, using Markdown.
Declaration
public static string MDCode(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with code. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDCodeBlock(String)
Formats the specified text as a code block, using Markdown.
Declaration
public static string MDCodeBlock(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with code blocks. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDCodeBlock(String, String)
Formats the specified text as a code block, using Markdown.
Declaration
public static string MDCodeBlock(this string value, string language)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with code blocks. |
System.String | language | The language to use for syntax highlighting. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDHeading(String, Int32)
Formats the specified text as a heading, using Markdown.
Declaration
public static string MDHeading(this string value, int level)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with italics. |
System.Int32 | level | The level of the heading. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDItalic(String)
Formats the specified text as italics, using Markdown.
Declaration
public static string MDItalic(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with italics. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
Remarks
Markdown has two methods of italicizing text: *
and _
. This method uses asterisks by default. To
use underscores, use MDItalic(String, Boolean) and pass true as the second argument.
MDItalic(String, Boolean)
Formats the specified text as italics, using Markdown.
Declaration
public static string MDItalic(this string value, bool useUnderscores)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with italics. |
System.Boolean | useUnderscores | Whether to use underscores instead of asterisks for italicizing. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDLink(Nullable<String>, String)
Formats the specified text as a link, using Markdown.
Declaration
public static string MDLink(this string? label, string url)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.String> | label | The label to use for the link. |
System.String | url | The URL to link to. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDLink(Nullable<String>, Uri)
Formats the specified text as a link, using Markdown.
Declaration
public static string MDLink(this string? label, Uri url)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.String> | label | The label to use for the link. |
Uri | url | The URL to link to. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDLink(Uri, Nullable<String>)
Formats the specified text as a link, using Markdown.
Declaration
public static string MDLink(this Uri url, string? label)
Parameters
Type | Name | Description |
---|---|---|
Uri | url | The URL to link to. |
System.Nullable<System.String> | label | The label to use for the link. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDStrikeOut(String)
Formats the specified text as striked out, using Markdown.
Declaration
public static string MDStrikeOut(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with strikeout. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |
MDUnderline(String)
Formats the specified text as underlined, using Markdown.
Declaration
public static string MDUnderline(this string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to surround with underline. |
Returns
Type | Description |
---|---|
System.String | The formatted text. |