> Markdown version of [Markdown](https://vaadin.com/docs/latest/fr/components/markdown). Section index: [llms.txt](https://vaadin.com/docs/latest/fr/components/llms.txt)

# Markdown

Le composant Markdown affiche le contenu écrit avec la syntaxe Markdown sous forme de HTML. Il prend en charge le formatage de texte de base, les listes, les liens, et plus encore. Tout le contenu fourni au composant est assaini en interne afin d’empêcher l’affichage de HTML potentiellement dangereux.

Pour plus d’informations sur les fonctionnalités courantes de la syntaxe Markdown, consultez le [Markdown Guide](https://www.markdownguide.org/basic-syntax/).

**Lit** — `markdown-basic.ts`

```html
const markdownText = `
## Rich Text Formatting

You can create **bold text**, *italicized text*, and \`inline code\` with simple Markdown syntax.
You can also ~~strike through~~ text when needed.

## Lists

### Ordered List:
1. First item
2. Second item
3. Third item with **bold text**

### Unordered List:
- Fruits
  - Apples 🍎
  - Bananas 🍌
  - Oranges 🍊
- Vegetables
  - Carrots
  - Broccoli

## Links & Quotes

> Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents.

[Visit Vaadin website](https://vaadin.com) | [Learn more about Markdown](https://www.markdownguide.org/)
    `;

    return html`<vaadin-markdown .content=${markdownText}></vaadin-markdown>`;
```

**Flow** — `MarkdownBasic.java`

```java
String markdownText = """
        ## Rich Text Formatting

        You can create **bold text**, *italicized text*, and `inline code` with simple Markdown syntax.
        You can also ~~strike through~~ text when needed.

        ## Lists

        ### Ordered List:
        1. First item
        2. Second item
        3. Third item with **bold text**

        ### Unordered List:
        - Fruits
            - Apples 🍎
            - Bananas 🍌
            - Oranges 🍊
        - Vegetables
            - Carrots
            - Broccoli

        ## Links & Quotes

        > Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents.

        [Visit Vaadin website](https://vaadin.com) | [Learn more about Markdown](https://www.markdownguide.org/)
        """;

Markdown markdown = new Markdown(markdownText);
add(markdown);
```

**React** — `markdown-basic.tsx`

```tsx
const markdownText = `
## Rich Text Formatting

You can create **bold text**, *italicized text*, and \`inline code\` with simple Markdown syntax.
You can also ~~strike through~~ text when needed.

## Lists

### Ordered List:
1. First item
2. Second item
3. Third item with **bold text**

### Unordered List:
- Fruits
  - Apples 🍎
  - Bananas 🍌
  - Oranges 🍊
- Vegetables
  - Carrots
  - Broccoli

## Links & Quotes

> Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents.

[Visit Vaadin website](https://vaadin.com) | [Learn more about Markdown](https://www.markdownguide.org/)
  `;

  return <Markdown>{markdownText}</Markdown>;
```

## <a id="sauts-de-ligne"></a>Sauts de ligne (V25.3 pre-release)

Par défaut, le composant suit la spécification Markdown d’origine : un seul saut de ligne au sein d’un paragraphe est réduit à un espace, et une ligne vide est nécessaire pour commencer un nouveau paragraphe. L’activation de l’option de sauts de ligne affiche les sauts de ligne simples (également appelés *soft breaks*) comme de véritables sauts de ligne, comme c’est généralement le cas dans les Markdown de type chat et messages. Les lignes vides commencent toujours un nouveau paragraphe.

**Lit** — `markdown-line-breaks.ts`

```typescript
Unresolved directive in <stdin> - include::../../../frontend/demo/component/markdown/markdown-line-breaks.ts[tags=snippet, indent=0]
```

**Flow** — `MarkdownLineBreaks.java`

```java
Unresolved directive in <stdin> - include::../../../src/main/java/com/vaadin/demo/component/markdown/MarkdownLineBreaks.java[tags=snippet, indent=0]
```

**React** — `markdown-line-breaks.tsx`

```tsx
Unresolved directive in <stdin> - include::../../../frontend/demo/component/markdown/react/markdown-line-breaks.tsx[tags=snippet, indent=0]
```

`77B51D28-FE42-4829-A315-D0F3C8A55BED`
