Function: markdown-compress-whitespace-string

markdown-compress-whitespace-string is a byte-compiled function defined in markdown-mode.el.

Signature

(markdown-compress-whitespace-string STR)

Documentation

Compress whitespace in STR and return result.

Leading and trailing whitespace is removed. Sequences of multiple spaces, tabs, and newlines are replaced with single spaces.

Source Code

;; Defined in ~/.emacs.d/elpa/markdown-mode-20260321.143/markdown-mode.el
;;; Miscellaneous =============================================================

(defun markdown-compress-whitespace-string (str)
  "Compress whitespace in STR and return result.
Leading and trailing whitespace is removed.  Sequences of multiple
spaces, tabs, and newlines are replaced with single spaces."
  (replace-regexp-in-string "\\(^[ \t\n]+\\|[ \t\n]+$\\)" ""
                            (replace-regexp-in-string "[ \t\n]+" " " str)))