Open ronakkaria opened 8 years ago
I'd been getting parse errors such as this in my unit tests
Error: Failed to execute 'setAttribute' on 'Element': '\n\'' is not a valid attribute name.
This happens when I define attributes on new lines for cleaner looking html files.
<div class="row" some-attr="bar" another attr="foo" </div>
Errors are fixed by changing the html to look like <div class="row" some-attr="bar" another-attr="foo" </div>
<div class="row" some-attr="bar" another-attr="foo" </div>
My question is why isn't the html minified before being converted to JS string? Or at least can that be an option?
Using html-minifier to minify the code before converting to JS strings works. I did a quick test.
I guess even github removed the new lines in from my HTML template.
The first version of the template:
<div class="row" some-attr="bar" another-attr="foo">
I'd been getting parse errors such as this in my unit tests
This happens when I define attributes on new lines for cleaner looking html files.
<div class="row" some-attr="bar" another attr="foo" </div>
Errors are fixed by changing the html to look like
<div class="row" some-attr="bar" another-attr="foo" </div>
My question is why isn't the html minified before being converted to JS string? Or at least can that be an option?
Using html-minifier to minify the code before converting to JS strings works. I did a quick test.