mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-19 11:15:49 +00:00
Interactive tutorials: fix bug with multiple spaces
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
// Helper functions for interactive tutorials
|
||||
|
||||
function slugify(s) {
|
||||
const unacceptable_chars = /[^A-Za-z0-9._ ]+/
|
||||
const whitespace_regex = /\s+/
|
||||
const unacceptable_chars = /[^A-Za-z0-9._ ]+/g
|
||||
const whitespace_regex = /\s+/g
|
||||
s = s.replace(unacceptable_chars, "")
|
||||
s = s.replace(whitespace_regex, "_")
|
||||
s = s.toLowerCase()
|
||||
|
||||
Reference in New Issue
Block a user