Function: denote--replace-consecutive-token-characters

denote--replace-consecutive-token-characters is a byte-compiled function defined in denote.el.

Signature

(denote--replace-consecutive-token-characters STR COMPONENT)

Documentation

Replace consecutive characters with a single one in STR.

Hyphens, underscores, equal signs and at signs are replaced with a single one in str, if necessary according to COMPONENT.

Source Code

;; Defined in ~/.emacs.d/elpa/denote-4.2.3/denote.el
(defun denote--replace-consecutive-token-characters (str component)
  "Replace consecutive characters with a single one in STR.
Hyphens, underscores, equal signs and at signs are replaced with
a single one in str, if necessary according to COMPONENT."
  (let ((str (replace-regexp-in-string
              "_\\{2,\\}" "_"
              (replace-regexp-in-string
               "=\\{2,\\}" "="
               (replace-regexp-in-string
                "@\\{2,\\}" "@" str)))))
    ;; -- are allowed in titles when the default sluggification is disabled
    (if (eq component 'title)
        str
      (replace-regexp-in-string
       "-\\{2,\\}" "-" str))))