summaryrefslogtreecommitdiffstats
path: root/libs/Contents.php
diff options
context:
space:
mode:
authorBigCoke233 <hi@guhub.cn>2020-04-15 18:13:28 +0800
committerBigCoke233 <hi@guhub.cn>2020-04-15 18:13:28 +0800
commita41eadd4f33b7f89dbf9c04964d55efd74583c32 (patch)
tree47e24e99c56a8c9f11773c9a8d568c274df98eea /libs/Contents.php
parentb07e8e34b35671ef2bde0712d03385c6b197c692 (diff)
:dizzy_face: Fix: 临时解决锚点中特殊字符的问题
Diffstat (limited to 'libs/Contents.php')
-rw-r--r--libs/Contents.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index ead2293..2d27671 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -233,6 +233,11 @@ class Contents
$id = str_replace(' ','_',$id);
$id = str_replace('&','_',$id);
$id = str_replace('?','_',$id);
+ $id = str_replace("'",'_',$id);
+ $id = str_replace('"','_',$id);
+ $id = str_replace('’','_',$id);
+ $id = str_replace('“','_',$id);
+ $id = str_replace('?','_',$id);
return '<h'.$matchs[1].$matchs[2].' id="'.$id.'">'.$matchs[3].'<a href="#'.$id.'" title="章节链接" class="post-toc-link no-line"><i class="iconfont icon-paragraph"></i></a></h'.$matchs[1].'>';
}