markdown支表格转换

This commit is contained in:
2023-03-08 18:48:21 +08:00
parent e04d406ea6
commit bd8dd37a80

View File

@@ -7,6 +7,7 @@ namespace app\model;
use app\common\model\Base;
use app\common\tools\PostBlock;
use app\common\tools\PostShow;
use League\HTMLToMarkdown\Converter\TableConverter;
use League\HTMLToMarkdown\HtmlConverter;
use think\facade\Cache;
use think\facade\Request;
@@ -166,6 +167,8 @@ class Post extends Base
$converter = new HtmlConverter(array('strip_tags' => true));
$converter->getEnvironment()->addConverter(new TableConverter());
$markdown = $converter->convert($content_html);
return $markdown;