From a0c88ba24afe48a4abffbf0373d57dbb7bced1fe Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 2 Mar 2023 18:31:20 +0800 Subject: [PATCH] =?UTF-8?q?markdown=E7=9B=AE=E5=BD=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/CoderDepotReadme.jsx | 3 ++- src/forge/Main/sub/ReadmeCatelogue.jsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/forge/Main/CoderDepotReadme.jsx b/src/forge/Main/CoderDepotReadme.jsx index 5e8bc3532..a99280452 100644 --- a/src/forge/Main/CoderDepotReadme.jsx +++ b/src/forge/Main/CoderDepotReadme.jsx @@ -22,7 +22,8 @@ function CoderDepotReadme({ operate , history , readme , ChangeFile }){ const items = $.map($("#readme").find("h1,h2,h3,h4,h5,h6"), function (el, _) { const anchor = el.id; const level = el.tagName.replace("H", ""); - const href = `#${anchor}`; + let id = anchor.replace(/[.,/#!$%^&*;:{}=\-_`~():,。¥;「」|?》《~·【】‘、!]/g,""); + const href = `#${id}`; return { href:`${href}`,text:el.textContent , level:level } }); setMenuList(items); diff --git a/src/forge/Main/sub/ReadmeCatelogue.jsx b/src/forge/Main/sub/ReadmeCatelogue.jsx index a913b152f..c84bae112 100644 --- a/src/forge/Main/sub/ReadmeCatelogue.jsx +++ b/src/forge/Main/sub/ReadmeCatelogue.jsx @@ -40,7 +40,7 @@ function ReadmeCatelogue({ menuList , hash }) { menu.map((item,key)=>{ return(