Skip to content
PHP Ecosystem
Explore

Markdown

API reference › yii › console › Markdown

classyii\console\Markdown
Extendscebe\markdown\Parser
Uses traitscebe\markdown\block\FencedCodeTrait, cebe\markdown\inline\CodeTrait, cebe\markdown\inline\EmphStrongTrait, cebe\markdown\inline\StrikeoutTrait
Since2.0
Sourceframework/console/Markdown.php

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

Based on cebe/markdown.

PropertyTypeDescriptionDefined by
$escapeCharacters protectedarrayThese are “escapeable” characters. Default: ['\\', '`', '*', '_', '~'].Markdown
MethodDescriptionDefined by
renderCode() protectedRenders a code block.Markdown
renderEmph() protectedRenders empathized elements.Markdown
renderInlineCode() protectedRenders an inline code span `.Markdown
renderParagraph() protectedRender a paragraph block.Markdown
renderStrike() protectedRenders the strike through feature.Markdown
renderStrong() protectedRenders strong elements.Markdown
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.

protected function renderCode(array $block): string

Renders a code block.

Parameters

ParameterTypeDescription
$blockarray

Returns

string

protected function renderEmph(array $element): string

Renders empathized elements.

Parameters

ParameterTypeDescription
$elementarray

Returns

string

protected function renderInlineCode(array $element): string

Renders an inline code span `.

Parameters

ParameterTypeDescription
$elementarray

Returns

string

protected function renderParagraph(array $block): string

Render a paragraph block.

Parameters

ParameterTypeDescription
$blockarray

Returns

string

protected function renderStrike(array $element): string

Renders the strike through feature.

Parameters

ParameterTypeDescription
$elementarray

Returns

string

protected function renderStrong(array $element): string

Renders strong elements.

Parameters

ParameterTypeDescription
$elementarray

Returns

string