Skip to content

Commit 370bef4

Browse files
committed
fix(SPA): 动态中的链接高亮显示
1 parent d42b178 commit 370bef4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/zhiyicx-plus-pc/src/helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function formatContent($content)
3939
{
4040
// 链接替换
4141
$content = preg_replace_callback('/((?:https?|mailto|ftp):\/\/([^\x{2e80}-\x{9fff}\s<\'\"“”‘’,。}]*)?)/u', function ($url) {
42-
return '<a href="'.$url[0].'">访问链接+</a>';
42+
return '<a class="mcolor" href="'.$url[0].'">访问链接+</a>';
4343
}, $content);
4444

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

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

0 commit comments

Comments
 (0)