diff options
| author | Eltrac <45323514+BigCoke233@users.noreply.github.com> | 2020-01-24 16:14:19 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-24 16:14:19 +0800 |
| commit | 18cb403e1b1afe969d9f29000e4668cb70788347 (patch) | |
| tree | af812de9751be2b1fcfc05dd37da2e1e450bcbeb | |
| parent | cb482ac9dc64b27f2f8cceaf6dc3e2b438a30dca (diff) | |
🔗 Perf: 文章内所有链接新窗口打开
| -rw-r--r-- | libs/Contents.php | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/Contents.php b/libs/Contents.php index a196c5d..a377a13 100644 --- a/libs/Contents.php +++ b/libs/Contents.php @@ -19,6 +19,8 @@ class Contents //由于实在没找到TE获取主题配置的相关函数,故只能用这种方法,吐了。 $text = empty($last) ? $data : $last; if ($widget instanceof Widget_Archive) { + //a 标签新窗口打开 + $text = preg_replace('/<a(.*?)>/s','<a${1} target="_blank">',$text); //Prism 高亮 $text = preg_replace('/<pre><code>/s','<pre><code class="language-html">',$text); //FancyBox |
