0 關注者

類別 yii\console\Markdown

繼承關係yii\console\Markdown » cebe\markdown\Parser
使用 Traitscebe\markdown\block\FencedCodeTrait, cebe\markdown\inline\CodeTrait, cebe\markdown\inline\EmphStrongTrait, cebe\markdown\inline\StrikeoutTrait
自版本起可用2.0
原始碼 https://github.com/yiisoft/yii2/blob/master/framework/console/Markdown.php

一個 Markdown 解析器,增強了在控制台環境中閱讀 markdown 的功能。

基於 cebe/markdown

受保護的屬性

隱藏繼承的屬性

屬性 類型 描述 定義於

受保護的方法

隱藏繼承的方法

方法 描述 定義於
renderCode() 渲染程式碼區塊。 yii\console\Markdown
renderEmph() 渲染強調的元素。 yii\console\Markdown
renderInlineCode() 渲染行內程式碼跨度 ` yii\console\Markdown
renderParagraph() 渲染段落區塊。 yii\console\Markdown
renderStrike() 渲染刪除線功能。 yii\console\Markdown
renderStrong() 渲染粗體元素。 yii\console\Markdown

屬性詳情

隱藏繼承的屬性

$escapeCharacters 受保護 屬性

這些是「可跳脫」字元。當使用其中一個字元並以反斜線作為前綴時,字元將在沒有反斜線的情況下輸出,並且不會被解釋為 markdown。

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

方法詳情

隱藏繼承的方法

renderCode() 受保護 方法

渲染程式碼區塊。

protected string renderCode ( $block )
$block array

                protected function renderCode($block)
{
    return Console::ansiFormat($block['content'], [Console::NEGATIVE]) . "\n\n";
}

            
renderEmph() 受保護 方法

渲染強調的元素。

protected string renderEmph ( $element )
$element array

                protected function renderEmph($element)
{
    return Console::ansiFormat($this->renderAbsy($element[1]), [Console::ITALIC]);
}

            
renderInlineCode() 受保護 方法

渲染行內程式碼跨度 `

protected string renderInlineCode ( $element )
$element array

                protected function renderInlineCode($element)
{
    return Console::ansiFormat($element[1], [Console::UNDERLINE]);
}

            
renderParagraph() 受保護 方法

渲染段落區塊。

protected string renderParagraph ( $block )
$block string

                protected function renderParagraph($block)
{
    return rtrim($this->renderAbsy($block['content'])) . "\n\n";
}

            
renderStrike() 受保護方法

渲染刪除線功能。

protected string renderStrike ( $element )
$element array

                protected function renderStrike($element)
{
    return Console::ansiFormat($this->parseInline($this->renderAbsy($element[1])), [Console::CROSSED_OUT]);
}

            
renderStrong() 受保護方法

渲染粗體元素。

protected string renderStrong ( $element )
$element array

                protected function renderStrong($element)
{
    return Console::ansiFormat($this->renderAbsy($element[1]), [Console::BOLD]);
}