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

View File

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