Skip to content

Commit

Permalink
fix(SPA): 动态中的链接高亮显示
Browse files Browse the repository at this point in the history
  • Loading branch information
mutoe committed Jan 15, 2019
1 parent d42b178 commit 370bef4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/zhiyicx-plus-pc/src/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function formatContent($content)
{
// 链接替换
$content = preg_replace_callback('/((?:https?|mailto|ftp):\/\/([^\x{2e80}-\x{9fff}\s<\'\"“”‘’,。}]*)?)/u', function ($url) {
return '<a href="'.$url[0].'">访问链接+</a>';
return '<a class="mcolor" href="'.$url[0].'">访问链接+</a>';
}, $content);

// 回车替换
Expand All @@ -49,7 +49,7 @@ function formatContent($content)

// 过滤xss
$config = HTMLPurifier_Config::createDefault();
$config->set('HTML.Allowed', 'br,a[href]');
$config->set('HTML.Allowed', 'br,a[href|class]');
$purifier = new HTMLPurifier($config);
$content = $purifier->purify($content);

Expand Down

0 comments on commit 370bef4

Please sign in to comment.