diff --git a/modules/lang/web/+html.el b/modules/lang/web/+html.el
index 3c33cc562..cec94b1b1 100644
--- a/modules/lang/web/+html.el
+++ b/modules/lang/web/+html.el
@@ -38,7 +38,10 @@
(cl-loop for pair in (cdr alist)
unless (string-match-p "^[a-z-]" (cdr pair))
collect (cons (car pair)
- (string-trim-right (cdr pair) "\\(?:>\\|]\\|}\\)+")))))
+ ;; TODO Replace with `string-trim-right' (Emacs 26+)
+ (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