Function: web-mode-buffer-change-attr-case

web-mode-buffer-change-attr-case is an interactive and natively compiled function defined in web-mode.el.

Signature

(web-mode-buffer-change-attr-case &optional TYPE)

Documentation

Change case of html attribute names.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/2qgnz1rp30nzfz6w0apx4kdm14if1bbs-emacs-packages-deps/share/emacs/site-lisp/elpa/web-mode-20260831.219/web-mode.el
(defun web-mode-buffer-change-attr-case (&optional type)
  "Change case of html attribute names."
  (interactive)
  (unless type (setq type "downcase"))
  (save-excursion
    (goto-char (point-min))
    (let ((continue t)
          (fun (if (eq (aref (downcase type) 0) ?u) 'uppercase 'downcase)))
      (while continue
        (cond
          ((not (web-mode-attribute-next))
           (setq continue nil))
          ((looking-at "\\([[:alnum:]-]+\\)")
           (replace-match (funcall fun (match-string 0)) t)
           )
          ) ;cond
        ) ;while
      )))