diff --git a/html/html.go b/html/html.go
index 2fdc454baa..8ed61f0d2b 100644
--- a/html/html.go
+++ b/html/html.go
@@ -75,10 +75,10 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st
return err
}
case html.CommentToken:
- if o.KeepConditionalComments && len(t.Text) > 6 && (bytes.HasPrefix(t.Text, []byte("[if ")) || bytes.Equal(t.Text, []byte("[endif]")) || bytes.Equal(t.Text, []byte(" 6 && (bytes.HasPrefix(t.Text, []byte("[if ")) || bytes.HasSuffix(t.Text, []byte("[endif]")) || bytes.HasSuffix(t.Text, []byte("[endif]--"))) {
// [if ...] is always 7 or more characters, [endif] is only encountered for downlevel-revealed
// see https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx#syntax
- if bytes.HasPrefix(t.Data, []byte("") { // downlevel-hidden
+ if bytes.HasPrefix(t.Data, []byte("")) { // downlevel-hidden
begin := bytes.IndexByte(t.Data, '>') + 1
end := len(t.Data) - len("")
if _, err := w.Write(t.Data[:begin]); err != nil {
diff --git a/html/html_test.go b/html/html_test.go
index dbd11eee32..65822b99b9 100644
--- a/html/html_test.go
+++ b/html/html_test.go
@@ -180,7 +180,9 @@ func TestHTMLKeepConditionalComments(t *testing.T) {
}{
{``, ``},
{` `, ``},
+ {` `, ``},
{` `, ``},
+ {` `, ``},
}
m := minify.New()