本文整理汇总了PHP中Markdown::decode方法的典型用法代码示例。如果您正苦于以下问题:PHP Markdown::decode方法的具体用法?PHP Markdown::decode怎么用?PHP Markdown::decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Markdown
的用法示例。
在下文中一共展示了Markdown::decode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDecoding
public function testDecoding()
{
$formatter = new Markdown();
$data = array('name' => 'Joe', 'age' => 21, 'employed' => true, 'body' => "Lorem ipsum dolor\nsit amet");
$raw = file_get_contents(__DIR__ . '/fixtures/joe.md');
$this->assertEquals($data, $formatter->decode($raw));
}
示例2: testNestedQuote
public function testNestedQuote()
{
$md = <<<TEXT
> this is a test quote
> > ## some heading
> > another text
and an reply to this quote
TEXT;
$actual = Markdown::decode($md);
$expect = '<blockquote>' . "\n";
$expect .= '<p>this is a test quote </p>' . "\n";
$expect .= '<h2>some heading</h2>' . "\n";
$expect .= '<p>another text </p>' . "\n";
$expect .= '</blockquote>' . "\n";
$expect .= '<p>and an reply to this quote </p>' . "\n";
$this->assertEquals($expect, $actual);
}