目录
当前位置: 首页 > 文档资料 > FuelPHP 中文文档 >

Markdown - 类別

优质
小牛编辑
119浏览
2023-12-01

纯文本到 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>