MarkdownString
Class sealed net8.0
Represents a string that contains Markdown-formatted content.
namespace Aspire.Hosting.Pipelines;
public sealed class MarkdownString{ // ...}Remarks
Section titled Remarks Use this type to explicitly indicate that a string value should be interpreted as Markdown when displayed in pipeline output. APIs that accept both
String and MarkdownString will render Markdown formatting (such as bold, links, and lists) only when a MarkdownString is provided; plain String values are displayed as-is without Markdown processing. Constructors1
Section titled ConstructorsMarkdownString(string) Initializes a new instance of the
MarkdownString class with the specified Markdown content. Properties1
Section titled PropertiesMethods1
Section titled MethodsExamples
Section titled Examples// Log a message with Markdown formattingstep.Log(LogLevel.Information, new MarkdownString("Deployed **myapp** to [endpoint](https://example.com)"));
// Add a Markdown-formatted value to the pipeline summarysummary.Add("Key", new MarkdownString($"[{name}]({url})"));