{"action":"created","issue":{"url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/5","repository_url":"https://api.github.com/repos/jfrolich/elixir-smoothie","labels_url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/5/comments","events_url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/5/events","html_url":"https://github.com/jfrolich/elixir-smoothie/issues/5","id":188583170,"number":5,"title":"cheerio.load improperly escaping characters","user":{"login":"nsimonson","id":7763225,"avatar_url":"https://avatars.githubusercontent.com/u/7763225?v=3","gravatar_id":"","url":"https://api.github.com/users/nsimonson","html_url":"https://github.com/nsimonson","followers_url":"https://api.github.com/users/nsimonson/followers","following_url":"https://api.github.com/users/nsimonson/following{/other_user}","gists_url":"https://api.github.com/users/nsimonson/gists{/gist_id}","starred_url":"https://api.github.com/users/nsimonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsimonson/subscriptions","organizations_url":"https://api.github.com/users/nsimonson/orgs","repos_url":"https://api.github.com/users/nsimonson/repos","events_url":"https://api.github.com/users/nsimonson/events{/privacy}","received_events_url":"https://api.github.com/users/nsimonson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-10T18:28:24Z","updated_at":"2016-11-11T19:33:28Z","closed_at":null,"body":"There's an issue with cheerio encoding apostrophes incorrectly. https://github.com/cheeriojs/cheerio/issues/319 \r\n\r\nIf I try to say use a string within my elixir variable `<img src=\"<%= static_url('/images/img.png') %>\">` This gets improperly escaped as `<img src=\"<%= static_url(&amp;apos;/images/img.png&amp;apos;) %>\">`. Wrapping this line with the Inky `<raw>` tag yields me `<img src=\"<%= static_url(&apos;/images/img.png&apos;) %>\">`. This is closer, but doesn't deal with cheerio escaping the initial single quote. This gets cleared up by setting the cheerioOpts `decodeEntities: false`.\r\n\r\n```\r\nlet $ = cheerio.load(escapeEex(template), {xmlMode: true, decodeEntities: false});\r\n```\r\n\r\nI'm not able to check if this has any side effects because `__tests__` seems to be missing the template directories."},"comment":{"url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/comments/260037106","html_url":"https://github.com/jfrolich/elixir-smoothie/issues/5#issuecomment-260037106","issue_url":"https://api.github.com/repos/jfrolich/elixir-smoothie/issues/5","id":260037106,"user":{"login":"nsimonson","id":7763225,"avatar_url":"https://avatars.githubusercontent.com/u/7763225?v=3","gravatar_id":"","url":"https://api.github.com/users/nsimonson","html_url":"https://github.com/nsimonson","followers_url":"https://api.github.com/users/nsimonson/followers","following_url":"https://api.github.com/users/nsimonson/following{/other_user}","gists_url":"https://api.github.com/users/nsimonson/gists{/gist_id}","starred_url":"https://api.github.com/users/nsimonson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nsimonson/subscriptions","organizations_url":"https://api.github.com/users/nsimonson/orgs","repos_url":"https://api.github.com/users/nsimonson/repos","events_url":"https://api.github.com/users/nsimonson/events{/privacy}","received_events_url":"https://api.github.com/users/nsimonson/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T19:33:28Z","updated_at":"2016-11-11T19:33:28Z","body":"I suppose this ends up being kind of moot since I've worked around the issue. I ended up building these links and passing the string in as a normal variable. \r\n\r\nSince images in emails always need to have absolute paths, Ideally I could do something like `<%= MyApp.Router.Helpers.static_url(MyApp.Endpoint, ~s(/images/img.png)) %>`. However everything within `<%= ... %>` gets pulled out into @variables and I get an unused variable warning. It's less of a bug and more of a flaw in how Smoothie deals with variables."}}
{"actor":{"display_login":"nsimonson"}}