Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8e8ac3a

Browse files
committed
fix: script
1 parent 04ab939 commit 8e8ac3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎main.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const isEn = () => location.hash.includes('README_EN');
33
const isRoot = () => ['', '#/', '#/README', '#/README_EN'].includes(location.hash);
44

55
const getSolutionPrefix = url => {
6-
const categories = ['javascript', 'shell','database'];
6+
const categories = ['javascript', 'database'];
77
const res = categories.find(
88
category =>
99
url.includes(category + '-solution') ||
@@ -27,8 +27,8 @@ const cleanedHtml = html => {
2727
};
2828

2929
const replaceHref = html => {
30-
const replacement = getSolutionPrefix(location.hash)+'solution';
31-
return replacement ? html.replace(/\(\/solution\//,`(${replacement}/`) : html;
30+
const prefix = getSolutionPrefix(location.hash);
31+
return prefix ? html.replaceAll('(/solution/','(/'+prefix+'solution/') : html;
3232
};
3333

3434
const getLang = () => (isEn() ? 'en' : 'zh-CN');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /