# Markdown Support

## Overview

Wisej.NET 4 now offers `Markdown` support alongside `HTML`. This enhancement benefits Wisej.AI by aligning with the preferences of `LLMs` for formatting responses in `Markdown`.

The conversion from `Markdown` to `HTML` occurs server-side, ensuring the browser receives `HTML` data without client-side JavaScript conversion.

For developers, we've added the `AllowMarkdown` property to complement the existing `AllowHtml` property. We also provide the `System.Markdown` class with a `ToHtml(string)` method. This method lets applications convert `Markdown` text to `HTML` format at any point.

## How to Use

To use `Markdown` in your application, set the `AllowMarkdown` property to "`true`". Then assign the `Markdown` text to the "`Text`" property for standard controls, or to the "`Value`" property for `DataGridViewCell` objects.

The example below shows a button in the designer and the "Text" property editor. You can mix `Markdown` and `HTML`.

<figure><img src="/files/tXr9V33Ex62bvnH2t0up" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/v9H5JpeZNxDVUcs8aRuf" alt=""><figcaption></figcaption></figure>

To convert `Markdown` to HTML programmatically, use the `Markdown.ToHtml(text)` method from the `System.Markdown` class:

```csharp
this.label1.AllowHtml = true;
this.label1.Text = Markdown.ToHtml("**Bold**");
```

{% hint style="warning" %}
Like the `AllowHtml` property, you cannot automatically resize controls with `HTML` content. This applies to `HTML` and `Markdown` content, as `Markdown` converts to `HTML` before rendering.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/docs/releases/whats-new-in-4.0/markdown-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
