replace replaceAll with replace

This commit is contained in:
Nitwel
2020-10-22 18:22:21 +02:00
parent 099d6eb8f3
commit 4c5c8cc629
4 changed files with 8 additions and 11 deletions

View File

@@ -54,12 +54,9 @@ export default defineComponent({
},
});
htmlString = htmlString.replaceAll(
hintRegex,
(match: string, type: string, title: string, body: string) => {
return `<div class="hint ${type}"><p class="hint-title">${title}</p><p class="hint-body">${body}</p></div>`;
}
);
htmlString = htmlString.replace(hintRegex, (match: string, type: string, title: string, body: string) => {
return `<div class="hint ${type}"><p class="hint-title">${title}</p><p class="hint-body">${body}</p></div>`;
});
html.value = htmlString;
}

View File

@@ -31,14 +31,14 @@ export default defineModule(({ i18n }) => {
for (const doc of directory.children) {
if (doc.type === 'file') {
routes.push({
path: '/' + doc.path.replace('.md', '').replaceAll('\\', '/'),
path: '/' + doc.path.replace('.md', '').replace(/\\/g, '/'),
component: StaticDocs,
});
} else if (doc.type === 'directory') {
if (doc.path && doc.children && doc.children.length > 0)
routes.push({
path: '/' + doc.path.replaceAll('\\', '/'),
redirect: '/' + doc.children![0].path.replace('.md', '').replaceAll('\\', '/'),
path: '/' + doc.path.replace(/\\/g, '/'),
redirect: '/' + doc.children![0].path.replace('.md', '').replace(/\\/g, '/'),
});
routes.push(...parseRoutes(doc));