Fixes id creator making inaccurate ids

This commit is contained in:
Emmaline Autumn 2024-08-21 14:34:35 -06:00
parent f6fc85bf7e
commit 3417fdd3d7
2 changed files with 8 additions and 3 deletions

View File

@ -802,7 +802,7 @@ export const buildOnlyDefaultElements = () => {
// on-demand resolver // on-demand resolver
registerIdentifier( registerIdentifier(
"on-demand resolver", "on-demand resolver",
/\?\?\[.*?\]\(.*?\)<<(.*?)>>/g, /\?\?\[.*?\](\(.*?\))<<(.*?)>>/g,
(s) => { (s) => {
const inp = s.match(/(?<=<<)(.*?)(?=>>)/)![0]; const inp = s.match(/(?<=<<)(.*?)(?=>>)/)![0];
const title = s.match(/(?<=\?\?\[)(.*?)(?=\])/)![0]; const title = s.match(/(?<=\?\?\[)(.*?)(?=\])/)![0];
@ -931,7 +931,7 @@ function search(
function generateId(t: string, usedIds: string[]) { function generateId(t: string, usedIds: string[]) {
let id = t let id = t
.toLowerCase() .toLowerCase()
.replace(/[^a-z\s]/gi, "") .replace(/[^a-z\s-\d]/gi, "")
.trim() .trim()
.replaceAll(" ", "-"); .replaceAll(" ", "-");
let idNum = 1; let idNum = 1;

View File

@ -12,4 +12,9 @@
3. my 3. my
4. name 4. name
5. is 5. is
6. welcome 6. welcome
- [-\_hello1234!@#$%^\&\*()-](#-_hello1234-)
# -_hello1234!@#$%^&*()-