The MarkdownString represents human-readable text that supports formatting via the markdown syntax. Standard markdown is supported, also tables, but no embedded html.

Rendering of {@link ThemeIcon theme icons} via the $(<name>)-syntax is supported when the {@linkcode MarkdownString.supportThemeIcons supportThemeIcons} is set to true.

Constructor

new(?value:String, ?supportThemeIcons:Bool)

Creates a new markdown string with the given value.

@link ThemeIcon ThemeIcons} are supported within the {@linkcode MarkdownString}.

Parameters:

value

Optional, initial value.

supportThemeIcons

Optional, Specifies whether {

Variables

isTrusted:Null<Bool>

Indicates that this markdown string is from a trusted source. Only trusted markdown supports links that execute commands, e.g. [Run it](command:myCommandId).

supportThemeIcons:Null<Bool>

Indicates that this markdown string can contain {@link ThemeIcon ThemeIcons}, e.g. $(zap).

value:String

The markdown string.

Methods

appendCodeblock(value:String, ?language:String):MarkdownString

Appends the given string as codeblock using the provided language. @link languages.getLanguages language identifier}.

Parameters:

value

A code snippet.

language

An optional {

appendMarkdown(value:String):MarkdownString

Appends the given string 'as is' to this markdown string. When {@linkcode MarkdownString.supportThemeIcons supportThemeIcons} is true, {@link ThemeIcon ThemeIcons} in the value will be iconified.

Parameters:

value

Markdown string.

appendText(value:String):MarkdownString

Appends and escapes the given string to this markdown string.

Parameters:

value

Plain text.