Skip to content

Commit

Permalink
HTML: keep empty title and lang attributes, fixes #331
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Sep 23, 2020
1 parent 24d4dfc commit e740908
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions html/html.go
Expand Up @@ -381,9 +381,7 @@ func (o *Minifier) Minify(m *minify.M, w io.Writer, r io.Reader, _ map[string]st
if len(val) == 0 && (attr.Hash == Class ||
attr.Hash == Dir ||
attr.Hash == Id ||
attr.Hash == Lang ||
attr.Hash == Name ||
attr.Hash == Title ||
attr.Hash == Action && t.Hash == Form) {
continue // omit empty attribute values
}
Expand Down
1 change: 1 addition & 0 deletions html/html_test.go
Expand Up @@ -146,6 +146,7 @@ func TestHTML(t *testing.T) {
{`<script><!--<`, `<script><!--<`},

// bugs
{`<input title=""><input lang="">`, `<input title><input lang>`}, // #331
{`<amp-analytics type=adobeanalytics_nativeConfig>`, `<amp-analytics type=adobeanalytics_nativeConfig>`}, // #270
{`<p>text</p><br>text`, `<p>text</p><br>text`}, // #122
{`text <img> text`, `text <img> text`}, // #89
Expand Down

0 comments on commit e740908

Please sign in to comment.