{"action":"created","issue":{"url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/1","labels_url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/1/comments","events_url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/1/events","html_url":"https://github.com/devm33/gulp-ng-template-strings/pull/1","id":114530258,"number":1,"title":"Use html-minifier to more robustly minify templates","user":{"login":"barm","id":1093763,"avatar_url":"https://avatars.githubusercontent.com/u/1093763?v=3","gravatar_id":"","url":"https://api.github.com/users/barm","html_url":"https://github.com/barm","followers_url":"https://api.github.com/users/barm/followers","following_url":"https://api.github.com/users/barm/following{/other_user}","gists_url":"https://api.github.com/users/barm/gists{/gist_id}","starred_url":"https://api.github.com/users/barm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barm/subscriptions","organizations_url":"https://api.github.com/users/barm/orgs","repos_url":"https://api.github.com/users/barm/repos","events_url":"https://api.github.com/users/barm/events{/privacy}","received_events_url":"https://api.github.com/users/barm/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-02T05:59:47Z","updated_at":"2015-11-04T19:21:27Z","closed_at":"2015-11-02T07:24:46Z","pull_request":{"url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/pulls/1","html_url":"https://github.com/devm33/gulp-ng-template-strings/pull/1","diff_url":"https://github.com/devm33/gulp-ng-template-strings/pull/1.diff","patch_url":"https://github.com/devm33/gulp-ng-template-strings/pull/1.patch"},"body":"Hey there! I ran into a problem with the string.replace method on line 55 of index.js:\r\n\r\n```js\r\ntemplate = template.replace(/\\s*\\n\\s*/g, '');\r\n```\r\n\r\nMore complex html elements, or those non-standard whitespace, were being broken by this line. This, for example:\r\n\r\n```html\r\n<video \r\n    src=\"\" \r\n    class=\"some-class\" \r\n    width=\"100%\" \r\n    height=\"100%\">\r\n</video>\r\n```\r\n\r\nwas being replaced with:\r\n\r\n```html\r\n<videosrc=\"\"class=\"some-class\"width=\"100%\"height=\"100%\"></video>\r\n```\r\n\r\nOne way to fix this would be to replace the whitespace with a single space, but I figured we should go all the way and use a proper html minifier. I've implemented https://github.com/kangax/html-minifier and added support for providing options to customize how it's handled, or to disable minification altogether.\r\n\r\nHappy to discuss the changes further. \r\n\r\nTODO later: we could add a couple more test cases to test each the three cases on the new line 55 (minify: undefined, minify: false, minify: {key: val})."},"comment":{"url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/comments/153836485","html_url":"https://github.com/devm33/gulp-ng-template-strings/pull/1#issuecomment-153836485","issue_url":"https://api.github.com/repos/devm33/gulp-ng-template-strings/issues/1","id":153836485,"user":{"login":"barm","id":1093763,"avatar_url":"https://avatars.githubusercontent.com/u/1093763?v=3","gravatar_id":"","url":"https://api.github.com/users/barm","html_url":"https://github.com/barm","followers_url":"https://api.github.com/users/barm/followers","following_url":"https://api.github.com/users/barm/following{/other_user}","gists_url":"https://api.github.com/users/barm/gists{/gist_id}","starred_url":"https://api.github.com/users/barm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barm/subscriptions","organizations_url":"https://api.github.com/users/barm/orgs","repos_url":"https://api.github.com/users/barm/repos","events_url":"https://api.github.com/users/barm/events{/privacy}","received_events_url":"https://api.github.com/users/barm/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T19:21:27Z","updated_at":"2015-11-04T19:21:27Z","body":":+1: :+1: "}}