Markdown 类別

純文本到 HTML 的轉換器,最初由 John Gruber 建立。 FuelPHP 使用 Michel Fortin 移植和擴充的版本

parse($text)

解析 Markdown 并回傳 HTML。

靜態
參数
參数 預設 描述
$text 必要 要解析的 Markdown 文本。
回傳 字串
範例
$string = '# About Markdown

Markdown is a text-to-HTML conversion tool for web writers.
Markdown allows you to write using an easy-to-read, easy-to-write
plain text format, then convert it to structurally valid HTML.

* It features bullet points
* As well as other handy features';

echo Markdown::parse($string);

回傳

<h1>About Markdown</h1>
<p>Markdown is a text-to-HTML conversion tool for web writers.
Markdown allows you to write using an easy-to-read, easy-to-write
plain text format, then convert it to structurally valid HTML.</p>
<ul>
<li>It features bullet points</li>
<li>As well as other handy features</li>
</ul>