Skip to content

Commit

Permalink
bugfix 解决 markdown 文档在文档没有内容时,启用阅读模式会报错 500 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
mylxsw committed Sep 19, 2022
1 parent 522e619 commit 1b1e31d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,10 @@ function convertSqlTo(string $sql, $callback)
*
* @return string
*/
function processMarkdown(string $markdown): string
function processMarkdown(string $markdown = null): string
{
if (is_null($markdown)) {$markdown = '';}

$defaultTOC = config('wizard.markdown.default_toc');
if (!in_array($defaultTOC, ['TOC', 'TOCM'])) {
return $markdown;
Expand Down Expand Up @@ -1024,4 +1026,4 @@ function highlight(string $content, string $keyword = null) :string {
// }

return $content;
}
}

0 comments on commit 1b1e31d

Please sign in to comment.