summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
Diffstat (limited to 'libs')
-rw-r--r--libs/Contents.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/Contents.php b/libs/Contents.php
index 75aa833..256ff46 100644
--- a/libs/Contents.php
+++ b/libs/Contents.php
@@ -229,7 +229,10 @@ class Contents
static public function parseHeaderCallback($matchs)
{
// 增加单独标记,否则冲突
- $id = 'toc_'.(self::$CurrentTocID++);
+ $id = $matchs[3];
+ $id = str_replace(' ','\%20',$id);
+ $id = str_replace('&','\%26',$id);
+ $id = str_replace('?','\%3F;',$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].'>';
}