diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el
index cec94b1b1..5c896e08c 100644
--- a/modules/lang/web/+html.el
+++ b/modules/lang/web/+html.el
@@ -39,9 +39,10 @@
unless (string-match-p "^[a-z-]" (cdr pair))
collect (cons (car pair)
;; TODO Replace with `string-trim-right' (Emacs 26+)
- (if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
- (replace-match "" t t string)
- string)))))
+ (let ((string (cdr pair)))
+ (if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
+ (replace-match "" t t string)
+ string))))))
(setf (alist-get nil web-mode-engines-auto-pairs) nil))
(map! :map web-mode-map