Markdown
API reference › yii › helpers › Markdown
Markdown provides an ability to transform markdown into HTML.
Basic usage is the following:
$myHtml = Markdown::process($myText); // use original markdown flavor$myHtml = Markdown::process($myText, 'gfm'); // use github flavored markdown$myHtml = Markdown::process($myText, 'extra'); // use markdown extraYou can configure multiple flavors using the $flavors property.
For more details please refer to the Markdown library documentation.
Note: The Markdown library works with PHPDoc annotations so if you use it together with PHP
opcachemake sure it does not strip comments.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$defaultFlavor static | string | The markdown flavor to use when none is specified explicitly. Default: 'original'. | BaseMarkdown |
$flavors static | array | A map of markdown flavor names to corresponding parser class configurations. Default: ['original' => ['class' => 'cebe\. | BaseMarkdown |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
process() static | Converts markdown into HTML. | BaseMarkdown |
processParagraph() static | Converts markdown into HTML but only parses inline elements. | BaseMarkdown |
getParser() protected static | BaseMarkdown |