我在 Laravel 应用程序中使用 PHP League Commonmark 包。Commonmark 的 convertToHtml() 返回用双引号括起来的 html。当然,此内容是在显示 html 标记的页面上呈现的。我正在使用演示者来转换从我的数据库返回的 md。我已经确认数据库中的内容中没有引号。
我以前用过这个包,找不到我做错了什么。谁能指出我正确的方向?
这是我的演示者(扩展类是 Laracasts 演示者):
class ContentPresenter extends Presenter
{
private $markdown;
public function bodyHtml()
{
$this->markdown = new CommonMarkConverter();
return $this->body ? $this->markdown->convertToHtml($this->body) : null;
}
}