Function: markdown-ts--slug-github

markdown-ts--slug-github is a byte-compiled function defined in markdown-ts-mode.el.gz.

Signature

(markdown-ts--slug-github TEXT)

Documentation

Return the GitHub-flavor slug for heading TEXT.

Mirrors the gh-slugger algorithm: lowercase, strip a fixed punctuation set, replace spaces with hyphens.

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/markdown-ts-mode.el.gz
(defun markdown-ts--slug-github (text)
  "Return the GitHub-flavor slug for heading TEXT.
Mirrors the gh-slugger algorithm: lowercase, strip a fixed
punctuation set, replace spaces with hyphens."
  (let* ((lc (downcase text))
         (stripped (replace-regexp-in-string
                    markdown-ts--slug-github-strip-re "" lc)))
    (replace-regexp-in-string "[[:blank:]]" "-" stripped)))