src/anchorSlugger.js
function getPandocId (text) {
  text = text
    .replace(emojiRegex(), '') // Strip emojis
    .toLowerCase()
    .trim()
    .replace(/%25|%/ig, '')   // remove single % signs
    .replace(RE_ENTITIES, '') // remove xml/html entities
    .replace(RE_SPECIALS, '') // single chars that are removed but not [.-]
    .replace(/\s+/g, '-')     // whitespaces
    .replace(/^-+|-+$/g, '')  // heading/ tailing hyphen
    .replace(RE_CJK, '')      // CJK punctuations that are removed

  if (/^[0-9-]+$/.test(text)) {
    text = 'section'
  }
  return text
}
function getPandocId (text) {
  text = text
    .replace(emojiRegex(), '') // Strip emojis
    .toLowerCase()
    .trim()
    .replace(/%25|%/ig, '')   // remove single % signs
    .replace(RE_ENTITIES, '') // remove xml/html entities
    .replace(RE_SPECIALS, '') // single chars that are removed but not [.-]
    .replace(/\s+/g, '-')     // whitespaces
    .replace(/^-+|-+$/g, '')  // heading/ tailing hyphen
    .replace(RE_CJK, '')      // CJK punctuations that are removed

  if (/^[0-9-]+$/.test(text)) {
    text = 'section'
  }
  return text
}
function getPandocId ( text ) { text = text . replace ( emojiRegex ( ) , '' ) // Strip emojis . toLowerCase ( ) . trim ( ) . replace ( / %25|% / ig , '' ) // remove single % signs . replace ( RE_ENTITIES , '' ) // remove xml/html entities . replace ( RE_SPECIALS , '' ) // single chars that are removed but not [.-] . replace ( / \s+ / g , '-' ) // whitespaces . replace ( / ^-+|-+$ / g , '' ) // heading/ tailing hyphen . replace ( RE_CJK , '' ) // CJK punctuations that are removed if ( / ^[0-9-]+$ / . test ( text ) ) { text = 'section' } return text }
getPandocId - anchors used at pandoc
@private
getPandocId - anchors used at pandoc