{"action":"created","issue":{"url":"https://api.github.com/repos/basecamp/trix/issues/139","labels_url":"https://api.github.com/repos/basecamp/trix/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/basecamp/trix/issues/139/comments","events_url":"https://api.github.com/repos/basecamp/trix/issues/139/events","html_url":"https://github.com/basecamp/trix/issues/139","id":123024614,"number":139,"title":"Support for populating Trix with content containing single or double quotation mark","user":{"login":"slowernet","id":991,"avatar_url":"https://avatars.githubusercontent.com/u/991?v=3","gravatar_id":"","url":"https://api.github.com/users/slowernet","html_url":"https://github.com/slowernet","followers_url":"https://api.github.com/users/slowernet/followers","following_url":"https://api.github.com/users/slowernet/following{/other_user}","gists_url":"https://api.github.com/users/slowernet/gists{/gist_id}","starred_url":"https://api.github.com/users/slowernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slowernet/subscriptions","organizations_url":"https://api.github.com/users/slowernet/orgs","repos_url":"https://api.github.com/users/slowernet/repos","events_url":"https://api.github.com/users/slowernet/events{/privacy}","received_events_url":"https://api.github.com/users/slowernet/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/basecamp/trix/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-18T20:55:57Z","updated_at":"2015-12-19T03:53:27Z","closed_at":"2015-12-19T03:12:58Z","body":"Prepopulation of the editor is now enabled by setting the `value` attribute of an id-linked `input`. This leads to problems when the content to be populated contains `['\"]` (based on whichever is used to delimit the value of `value` in the markup). \r\n\r\nSome possible solutions, pros & cons:\r\n\r\n**Allow content to be set inside the `trix-editor` block.** More like `textarea`. The `README` alludes to this being unsafe?\r\n\r\n**Require that all content is HTML entity encoded.** May not be the desired stored form. Not an easily accessible transformation in all server-side languages.\r\n\r\n**Trix unescapes `value` via `decodeURIComponent`.** Again, the exact transformation performed via `encodeURIComponent` is not trivial on the server side.\r\n\r\n**Trix unescapes `value` via `JSON.parse`.** The equivalent of `JSON.stringify` seems fairly universally available on the server. The unescape could be triggered by an optional custom attribute on `trix-editor`. \r\n\r\nThanks for your time."},"comment":{"url":"https://api.github.com/repos/basecamp/trix/issues/comments/165943365","html_url":"https://github.com/basecamp/trix/issues/139#issuecomment-165943365","issue_url":"https://api.github.com/repos/basecamp/trix/issues/139","id":165943365,"user":{"login":"slowernet","id":991,"avatar_url":"https://avatars.githubusercontent.com/u/991?v=3","gravatar_id":"","url":"https://api.github.com/users/slowernet","html_url":"https://github.com/slowernet","followers_url":"https://api.github.com/users/slowernet/followers","following_url":"https://api.github.com/users/slowernet/following{/other_user}","gists_url":"https://api.github.com/users/slowernet/gists{/gist_id}","starred_url":"https://api.github.com/users/slowernet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slowernet/subscriptions","organizations_url":"https://api.github.com/users/slowernet/orgs","repos_url":"https://api.github.com/users/slowernet/repos","events_url":"https://api.github.com/users/slowernet/events{/privacy}","received_events_url":"https://api.github.com/users/slowernet/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T03:53:27Z","updated_at":"2015-12-19T03:53:27Z","body":"Well, any form field other than a textarea. But fair enough."}}