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

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

Signature

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

Documentation

Change html tag case.

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
;;---- TRANSFORMATION ----------------------------------------------------------

(defun web-mode-buffer-change-tag-case (&optional type)
  "Change html tag case."
  (interactive)
  (save-excursion
    (goto-char (point-min))
    (let ((continue t) f)
      (setq f (if (member type '("upper" "uppercase" "upper-case")) 'uppercase 'downcase))
      (when (and (not (get-text-property (point) 'tag-beg))
                 (not (web-mode-tag-next)))
        (setq continue nil))
      (while continue
        (skip-chars-forward "<!/")
        (if (looking-at "\\([[:alnum:]:-]+\\)")
            (replace-match (funcall f (match-string 0)) t))
        ;;        (message "tag: %S (%S)"
        ;;                 (get-text-property (point) 'tag-name)
        ;;                 (point))
        (unless (web-mode-tag-next)
          (setq continue nil))
        ) ;while
      )))