mirror of
https://github.com/directus/directus.git
synced 2026-01-23 06:28:20 -05:00
Merge pull request #762 from directus/fix-750
Replace `replaceAll` with `replace`
This commit is contained in:
@@ -263,7 +263,7 @@ export default defineComponent({
|
||||
if (part.startsWith('{{') === false) {
|
||||
return `<span class="text">${part}</span>`;
|
||||
}
|
||||
const fieldKey = part.replaceAll(/({|})/g, '').trim();
|
||||
const fieldKey = part.replace(/({|})/g, '').trim();
|
||||
const field = findTree(tree.value, fieldKey.split('.'));
|
||||
|
||||
if (!field) return '';
|
||||
|
||||
@@ -131,7 +131,7 @@ export default defineComponent({
|
||||
|
||||
if (props.capitalization === 'auto-format') val = formatTitle(val, new RegExp(whitespace));
|
||||
|
||||
val = val.replaceAll(/ +/g, whitespace);
|
||||
val = val.replace(/ +/g, whitespace);
|
||||
|
||||
return val;
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user