Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JQuery parse errors with new line escapes #88

Open
ronakkaria opened this issue Mar 4, 2016 · 1 comment
Open

JQuery parse errors with new line escapes #88

ronakkaria opened this issue Mar 4, 2016 · 1 comment

Comments

@ronakkaria
Copy link

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"

`

Errors are fixed by changing the html to look like
`<div class="row" some-attr="bar" another-attr="foo"

`

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.

@ronakkaria
Copy link
Author

I guess even github removed the new lines in from my HTML template.

The first version of the template:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant