quantum-markdown/lib/index.js
function sluggifyText (text) {
  const slug = unEscapeHtmlTags(text).toLowerCase()
    // Replace 'unsafe' chars with dashes (!!!! is changed to -)
    .replace(unsafeCharsRegex, '-')
    // Replace multiple concurrent dashes with a single dash
    .replace(multiDashRegex, '-')
    // Remove trailing -
    .replace(lastCharDashRegex, '')
  // Encode the resulting string to make it url-safe
  return encodeURIComponent(slug)
}
function sluggifyText (text) {
  const slug = unEscapeHtmlTags(text).toLowerCase()
    // Replace 'unsafe' chars with dashes (!!!! is changed to -)
    .replace(unsafeCharsRegex, '-')
    // Replace multiple concurrent dashes with a single dash
    .replace(multiDashRegex, '-')
    // Remove trailing -
    .replace(lastCharDashRegex, '')
  // Encode the resulting string to make it url-safe
  return encodeURIComponent(slug)
}
function sluggifyText ( text ) { const slug = unEscapeHtmlTags ( text ) . toLowerCase ( ) // Replace 'unsafe' chars with dashes (!!!! is changed to -) . replace ( unsafeCharsRegex , '-' ) // Replace multiple concurrent dashes with a single dash . replace ( multiDashRegex , '-' ) // Remove trailing - . replace ( lastCharDashRegex , '' ) // Encode the resulting string to make it url-safe return encodeURIComponent ( slug ) }
Takes a text string and returns a url-safe string for use when de-duplicating
Takes a text string and returns a url - safe string for use when de - duplicating