# Markdown

> A Markdown parser that enhances markdown for reading in console environments.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [console](/docs/api/yii/console/index.md) › Markdown

| class | `yii\console\Markdown` |
| --- | --- |
| Extends | `cebe\markdown\Parser` |
| Uses traits | `cebe\markdown\block\FencedCodeTrait`, `cebe\markdown\inline\CodeTrait`, `cebe\markdown\inline\EmphStrongTrait`, `cebe\markdown\inline\StrikeoutTrait` |
| Since | 2.0 |
| Source | [`framework/console/Markdown.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/console/Markdown.php#L25) |

A Markdown parser that enhances markdown for reading in console environments.

Based on [cebe/markdown](https://github.com/cebe/markdown).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| [`$escapeCharacters`](#property-escapeCharacters) protected | `array` | These are "escapeable" characters. Default: `` ['\\', '`', '*', '_', '~'] ``. | `Markdown` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`renderCode()`](#method-renderCode) protected | Renders a code block. | `Markdown` |
| [`renderEmph()`](#method-renderEmph) protected | Renders empathized elements. | `Markdown` |
| [`renderInlineCode()`](#method-renderInlineCode) protected | Renders an inline code span `` ` ``. | `Markdown` |
| [`renderParagraph()`](#method-renderParagraph) protected | Render a paragraph block. | `Markdown` |
| [`renderStrike()`](#method-renderStrike) protected | Renders the strike through feature. | `Markdown` |
| [`renderStrong()`](#method-renderStrong) protected | Renders strong elements. | `Markdown` |

## Property details

### $escapeCharacters <span id="property-escapeCharacters"></span>

```php
protected array $escapeCharacters = ['\\', '`', '*', '_', '~']
```

These are "escapeable" characters.

When using one of these prefixed with a
backslash, the character will be outputted without the backslash and is not interpreted
as markdown.

## Method details

### renderCode() <span id="method-renderCode"></span>

```php
protected function renderCode(array $block): string
```

Renders a code block.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$block` | `array` |  |

**Returns**

`string`

### renderEmph() <span id="method-renderEmph"></span>

```php
protected function renderEmph(array $element): string
```

Renders empathized elements.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$element` | `array` |  |

**Returns**

`string`

### renderInlineCode() <span id="method-renderInlineCode"></span>

```php
protected function renderInlineCode(array $element): string
```

Renders an inline code span `` ` ``.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$element` | `array` |  |

**Returns**

`string`

### renderParagraph() <span id="method-renderParagraph"></span>

```php
protected function renderParagraph(array $block): string
```

Render a paragraph block.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$block` | `array` |  |

**Returns**

`string`

### renderStrike() <span id="method-renderStrike"></span>

```php
protected function renderStrike(array $element): string
```

Renders the strike through feature.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$element` | `array` |  |

**Returns**

`string`

### renderStrong() <span id="method-renderStrong"></span>

```php
protected function renderStrong(array $element): string
```

Renders strong elements.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$element` | `array` |  |

**Returns**

`string`