{"action":"created","issue":{"url":"https://api.github.com/repos/haml/haml/issues/940","repository_url":"https://api.github.com/repos/haml/haml","labels_url":"https://api.github.com/repos/haml/haml/issues/940/labels{/name}","comments_url":"https://api.github.com/repos/haml/haml/issues/940/comments","events_url":"https://api.github.com/repos/haml/haml/issues/940/events","html_url":"https://github.com/haml/haml/issues/940","id":240932628,"number":940,"title":"Javascript escaping invalid, generates SyntaxError: expected expression, got '&'","user":{"login":"javinto","id":363831,"avatar_url":"https://avatars0.githubusercontent.com/u/363831?v=4","gravatar_id":"","url":"https://api.github.com/users/javinto","html_url":"https://github.com/javinto","followers_url":"https://api.github.com/users/javinto/followers","following_url":"https://api.github.com/users/javinto/following{/other_user}","gists_url":"https://api.github.com/users/javinto/gists{/gist_id}","starred_url":"https://api.github.com/users/javinto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javinto/subscriptions","organizations_url":"https://api.github.com/users/javinto/orgs","repos_url":"https://api.github.com/users/javinto/repos","events_url":"https://api.github.com/users/javinto/events{/privacy}","received_events_url":"https://api.github.com/users/javinto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2017-07-06T11:56:46Z","updated_at":"2017-09-15T12:12:26Z","closed_at":"2017-07-10T10:32:18Z","author_association":"NONE","body":"The 5.0.0 release notes refers to: \r\n\r\n> HTML escape interpolated code in filters. #770 (Matt Wildig)\r\n> ```\r\n> :javascript\r\n>     #{JSON.generate(foo: \"bar\")}\r\n>   Haml 4 output: {\"foo\":\"bar\"}\r\n>   Haml 5 output: {&quot;foo&quot;:&quot;bar&quot;}\r\n> ```\r\n\r\nHowever, I have (Haml 5.0.1):\r\n\r\n```\r\n:javascript\r\n  var list1= [\"a\", 'b', 'c'];\r\n  var hash1= {a: \"a\", b: 'b'};\r\n  var list2= #{JSON.generate( [:a, :b, :c])};\r\n  var hash2= #{JSON.generate(foo: \"bar\")};\r\n```\r\nIn the browser this results into:\r\n\r\n```\r\n<script>\r\n  var list1= [\"a\", 'b', 'c'];\r\n  var hash1= {a: \"a\", b: 'b'};\r\n  var list2= [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;];\r\n  var hash2= {&quot;foo&quot;:&quot;bar&quot;};\r\n</script>\r\n```\r\n\r\nThe browsers runs into an error on line 4 (list2) and 5 (hash2): \r\n\r\n> SyntaxError: expected expression, got '&'\r\n"},"comment":{"url":"https://api.github.com/repos/haml/haml/issues/comments/329764487","html_url":"https://github.com/haml/haml/issues/940#issuecomment-329764487","issue_url":"https://api.github.com/repos/haml/haml/issues/940","id":329764487,"user":{"login":"baelter","id":1399369,"avatar_url":"https://avatars1.githubusercontent.com/u/1399369?v=4","gravatar_id":"","url":"https://api.github.com/users/baelter","html_url":"https://github.com/baelter","followers_url":"https://api.github.com/users/baelter/followers","following_url":"https://api.github.com/users/baelter/following{/other_user}","gists_url":"https://api.github.com/users/baelter/gists{/gist_id}","starred_url":"https://api.github.com/users/baelter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baelter/subscriptions","organizations_url":"https://api.github.com/users/baelter/orgs","repos_url":"https://api.github.com/users/baelter/repos","events_url":"https://api.github.com/users/baelter/events{/privacy}","received_events_url":"https://api.github.com/users/baelter/received_events","type":"User","site_admin":false},"created_at":"2017-09-15T12:12:26Z","updated_at":"2017-09-15T12:12:26Z","author_association":"NONE","body":"example please"}}
{"actor":{"display_login":"baelter"}}