diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim
index 7736b5b054..26b99d2bc3 100644
--- a/runtime/ftplugin/html.vim
+++ b/runtime/ftplugin/html.vim
@@ -2,9 +2,7 @@
" Language: HTML
" Maintainer: Doug Kearns
" Previous Maintainer: Dan Sharp
-" Last Change: 2024 Jan 14
-" 2024 May 24 update 'commentstring' option
-" 2025 May 10 add expression folding #17141
+" Last Change: 2025 Sep 12
if exists("b:did_ftplugin")
finish
@@ -18,7 +16,12 @@ setlocal matchpairs+=<:>
setlocal commentstring=
setlocal comments=s:
-let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<"
+if exists('b:undo_ftplugin')
+ " no whitespace before |, handle possible :unmap at end of current value
+ let b:undo_ftplugin ..= "| setlocal comments< commentstring< matchpairs<"
+else
+ let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<"
+endif
if get(g:, "ft_html_autocomment", 0)
setlocal formatoptions-=t formatoptions+=croql