mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-23 05:05:50 +00:00
Migrate interactive tutorials (post realm v0.70)
Attempt migrating interactive tutorial again Migrate interactive tutorial snippet syntax Interactive tutorials: partially migrate send-xrp, no-freeze to new syntax Fix Send XRP interactive tutorial Interactive tutorials: fixes for Redocly incl. localization challenges Interactive tutorials: switch defaultValue back to value in anticipation of Redocly bugfix Fix document.ready→window.onRouteChange, cyclers, etc. in interactive tutorials.
This commit is contained in:
@@ -51,3 +51,16 @@ export function slugify(s) {
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
export function idify(s: string) {
|
||||
// like slugify, but more unicode-friendly.
|
||||
// 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.
|
||||
//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(/[\s-]+/gu, '-')
|
||||
if (!s) {
|
||||
s = "_";
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user