diff --git a/modules/markup/html.go b/modules/markup/html.go
index b462b6b34b6..3d218c407ed 100644
--- a/modules/markup/html.go
+++ b/modules/markup/html.go
@@ -298,7 +298,7 @@ func RenderEmoji(
return ctx.postProcess(rawHTML)
}
-var tagCleaner = regexp.MustCompile(`<((?:/?\w+/\w+)|(?:/[\w ]+/)|(/?[hH][tT][mM][lL][ />])|(/?[hH][eE][aA][dD][ />]))`)
+var tagCleaner = regexp.MustCompile(`<((?:/?\w+/\w+)|(?:/[\w ]+/)|(/?[hH][tT][mM][lL]\b)|(/?[hH][eE][aA][dD]\b))`)
var nulCleaner = strings.NewReplacer("\000", "")
func (ctx *postProcessCtx) postProcess(rawHTML []byte) ([]byte, error) {