Skip to content

Commit

Permalink
更新 short-code.php
Browse files Browse the repository at this point in the history
增加pre解析。否则pre无法解析导致文章没有代码嵌入效果。
  • Loading branch information
happykl-cn committed Nov 28, 2023
1 parent 4ff49e8 commit cfb3851
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/fun/short-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ function pk_shortcode_register()
}
return $list;
}
// 解析pre标签 感谢阿云。小恐龙太好拉注。
function pk_pre($atts, $content = null) {
$content = '<pre>' . htmlspecialchars($content) . '</pre>';
return $content;
}
add_shortcode('pre', 'pk_pre');

//提示框部分
function sc_tips($attr, $content, $tag)
Expand Down

0 comments on commit cfb3851

Please sign in to comment.