@@ -116,6 +116,7 @@ func TestHTML(t *testing.T) {
116116 {`a <strike> b </strike> c` , `a <strike>b </strike>c` },
117117 {`a <svg>` , `a <svg>` },
118118 {"<h5>\n Lorem & ipsum\n dolor sid amet\n </h5>" , "<h5>Lorem & ipsum\n dolor sid amet</h5>" },
119+ {`cats <br> dogs ` , `cats<br>dogs` },
119120
120121 // from HTML Minifier
121122 {`<DIV TITLE="blah">boo</DIV>` , `<div title=blah>boo</div>` },
@@ -369,8 +370,6 @@ func TestHTMLTemplates(t *testing.T) {
369370 html string
370371 expected string
371372 }{
372- {`a<p> {{ printf " ! " }} </p>b` , `a<p> {{ printf " ! " }} </p>b` },
373- {`a<span> {{ printf " ! " }} </span>b` , `a<span> {{ printf " ! " }} </span>b` },
374373 {`<a href={{ .Link }} />` , `<a href={{ .Link }}>` },
375374 {`<input type="file" accept="{{ .Accept }}, image/jpeg">` , `<input type=file accept="{{ .Accept }}, image/jpeg">` },
376375 {`<option value="0" {{ if eq .Type 0 }}selected{{ end }}>Foo</option>` , `<option value=0 {{ if eq .Type 0 }}selected{{ end }}>Foo` },
@@ -382,6 +381,13 @@ func TestHTMLTemplates(t *testing.T) {
382381 {`<p>Hello <code>{{""}}</code> there</p>` , `<p>Hello <code>{{""}}</code> there` },
383382 {`<select><option>Default</option>{{range $i, $lang := .Languages}}<option>{{$lang}}</option>{{end}}</select>` , `<select><option>Default{{range $i, $lang := .Languages}}<option>{{$lang}}{{end}}</select>` },
384383 {`<tr{{if .Deleted}} class="is-disabled"{{end}}>` , `<tr{{if .Deleted}} class="is-disabled"{{end}}>` },
384+
385+ // whitespace
386+ {`{{ printf " ! " }}` , `{{ printf " ! " }}` },
387+ {`a<p> {{a}} </p>b` , `a<p>{{a}}</p>b` },
388+ {`a<span> {{a}} </span>b` , `a<span> {{a}} </span>b` },
389+ {`a <span> {{a}} </span> b` , `a <span>{{a}} </span>b` },
390+ {` {{a}} {{b}} ` , `{{a}} {{b}}` },
385391 }
386392
387393 m := minify .New ()
0 commit comments