mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-09 14:25:50 +00:00
Update idify in helper.ts
This commit is contained in:
@@ -57,7 +57,8 @@ export function idify(s: string) {
|
|||||||
// for some reason the better version using \p gives an "s12 is undefined" TypeError sometimes,
|
// for some reason the better version using \p gives an "s12 is undefined" TypeError sometimes,
|
||||||
// so it's disabled for now. With that fixed, we could use localized step names in interactive tutorials.
|
// so it's disabled for now. With that fixed, we could use localized step names in interactive tutorials.
|
||||||
//s = s.replace(/[^\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}]/gu, '').trim().toLowerCase()
|
//s = s.replace(/[^\p{Alphabetic}\p{Mark}\p{Decimal_Number}\p{Connector_Punctuation}\p{Join_Control}]/gu, '').trim().toLowerCase()
|
||||||
s = s.replace(/[^\w\s-]/gu, '').trim().toLowerCase()
|
//s = s.replace(/[^\w\s-]/gu, '').trim().toLowerCase()
|
||||||
|
s = s.replace(/([^\w]|[\s-])/gu, '').trim().toLowerCase()
|
||||||
s = s.replace(/[\s-]+/gu, '-')
|
s = s.replace(/[\s-]+/gu, '-')
|
||||||
if (!s) {
|
if (!s) {
|
||||||
s = "_";
|
s = "_";
|
||||||
|
|||||||
Reference in New Issue
Block a user