{"action":"created","issue":{"url":"https://api.github.com/repos/prose/prose/issues/937","repository_url":"https://api.github.com/repos/prose/prose","labels_url":"https://api.github.com/repos/prose/prose/issues/937/labels{/name}","comments_url":"https://api.github.com/repos/prose/prose/issues/937/comments","events_url":"https://api.github.com/repos/prose/prose/issues/937/events","html_url":"https://github.com/prose/prose/issues/937","id":143077596,"number":937,"title":"Entities in metadata text fields being double-escaped","user":{"login":"tfe","id":21501,"avatar_url":"https://avatars.githubusercontent.com/u/21501?v=3","gravatar_id":"","url":"https://api.github.com/users/tfe","html_url":"https://github.com/tfe","followers_url":"https://api.github.com/users/tfe/followers","following_url":"https://api.github.com/users/tfe/following{/other_user}","gists_url":"https://api.github.com/users/tfe/gists{/gist_id}","starred_url":"https://api.github.com/users/tfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfe/subscriptions","organizations_url":"https://api.github.com/users/tfe/orgs","repos_url":"https://api.github.com/users/tfe/repos","events_url":"https://api.github.com/users/tfe/events{/privacy}","received_events_url":"https://api.github.com/users/tfe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-23T20:55:35Z","updated_at":"2016-04-12T22:22:13Z","closed_at":null,"body":"I've got some text fields configured for the post metadata to add e.g. title, description. I'm seeing an issue where prose is replacing some characters with their HTML entities upon editing, but it doesn't seem to be undoing that later resulting in double- and triple-encoded entities.\r\n\r\nA concrete example:\r\n\r\nWhen starting out, I have this in the text field:\r\n\r\n![screen shot 2016-03-23 at 1 46 42 pm](https://cloud.githubusercontent.com/assets/21501/14000307/f5b15956-f0fd-11e5-90fd-5252a39159c8.png)\r\n\r\nThe apostrophe in \"we're\" is a standard apostrophe char, nothing fancy. When I save this, I get this in the actual source file, as expected:\r\n\r\n![screen shot 2016-03-23 at 1 49 16 pm](https://cloud.githubusercontent.com/assets/21501/14000350/1ac314b4-f0fe-11e5-9336-957064b31cee.png)\r\n\r\nIf I edit again though, this is what I see in the editor. The entity is the HTML entity for a standard apostrophe:\r\n\r\n![screen shot 2016-03-23 at 1 51 05 pm](https://cloud.githubusercontent.com/assets/21501/14000406/5d742244-f0fe-11e5-9d54-8289568737fd.png)\r\n\r\nAnd this is what is saved in the source file:\r\n\r\n![screen shot 2016-03-23 at 1 52 45 pm](https://cloud.githubusercontent.com/assets/21501/14000468/95644e04-f0fe-11e5-883b-53d20a3cd58a.png)\r\n\r\nThe third time, the ampersand gets replaced with its entity, and this continues recursively forever on each edit:\r\n\r\n![screen shot 2016-03-23 at 1 53 45 pm](https://cloud.githubusercontent.com/assets/21501/14000499/b88678e4-f0fe-11e5-936b-9d5110f406bf.png)\r\n\r\n![screen shot 2016-03-23 at 1 53 59 pm](https://cloud.githubusercontent.com/assets/21501/14000504/bacd41aa-f0fe-11e5-97e7-4f09136ab34e.png)\r\n\r\nI looked through the open and closed issues but it seems no one else is encountering this, which seems strange because I'd think it would be a super-common issue if it were happening to everybody.\r\n\r\nIt's happening on totally stock OS X with latest Safari."},"comment":{"url":"https://api.github.com/repos/prose/prose/issues/comments/209127225","html_url":"https://github.com/prose/prose/issues/937#issuecomment-209127225","issue_url":"https://api.github.com/repos/prose/prose/issues/937","id":209127225,"user":{"login":"andrew-luminal","id":13007059,"avatar_url":"https://avatars.githubusercontent.com/u/13007059?v=3","gravatar_id":"","url":"https://api.github.com/users/andrew-luminal","html_url":"https://github.com/andrew-luminal","followers_url":"https://api.github.com/users/andrew-luminal/followers","following_url":"https://api.github.com/users/andrew-luminal/following{/other_user}","gists_url":"https://api.github.com/users/andrew-luminal/gists{/gist_id}","starred_url":"https://api.github.com/users/andrew-luminal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrew-luminal/subscriptions","organizations_url":"https://api.github.com/users/andrew-luminal/orgs","repos_url":"https://api.github.com/users/andrew-luminal/repos","events_url":"https://api.github.com/users/andrew-luminal/events{/privacy}","received_events_url":"https://api.github.com/users/andrew-luminal/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T22:22:13Z","updated_at":"2016-04-12T22:22:13Z","body":"I've been having this issue as well. Was debugging and realized that this could be fixed by changing this line:\r\nhttps://github.com/prose/prose/blob/f8092a72b00be8065a29498d309c3f843fb14a3a/app/views/meta/textarea.js#L84\r\n\r\n...to NOT call `_.escape`. Should I make a PR?"}}