{"action":"created","issue":{"url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/224","repository_url":"https://api.github.com/repos/decaffeinate/decaffeinate","labels_url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/224/comments","events_url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/224/events","html_url":"https://github.com/decaffeinate/decaffeinate/pull/224","id":154929050,"number":224,"title":"WIP - Improve multi line string support","user":{"login":"iainb","id":801888,"avatar_url":"https://avatars.githubusercontent.com/u/801888?v=3","gravatar_id":"","url":"https://api.github.com/users/iainb","html_url":"https://github.com/iainb","followers_url":"https://api.github.com/users/iainb/followers","following_url":"https://api.github.com/users/iainb/following{/other_user}","gists_url":"https://api.github.com/users/iainb/gists{/gist_id}","starred_url":"https://api.github.com/users/iainb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iainb/subscriptions","organizations_url":"https://api.github.com/users/iainb/orgs","repos_url":"https://api.github.com/users/iainb/repos","events_url":"https://api.github.com/users/iainb/events{/privacy}","received_events_url":"https://api.github.com/users/iainb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-15T20:41:58Z","updated_at":"2016-05-16T14:06:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/decaffeinate/decaffeinate/pulls/224","html_url":"https://github.com/decaffeinate/decaffeinate/pull/224","diff_url":"https://github.com/decaffeinate/decaffeinate/pull/224.diff","patch_url":"https://github.com/decaffeinate/decaffeinate/pull/224.patch"},"body":"This is a work in progress, looking for a bit of feedback (it has broken tests, though they're of interest).\r\n\r\nI started working on a fix for  #220 and discovered that there are some edge cases where decaffeinate does not convert triple quoted strings into template literals correctly or double quoted multi line strings that contain string interpolation (this is in addition to #220).\r\n\r\nThis PR starts to fix the problem (though its a little rough around the edges), it tries to convert strings correctly but does so at the expense of losing some of the original formatting.\r\n\r\nAn example \r\n```coffeescript\r\n() ->\r\n    return \"\"\"multi line\r\n              triple\\nquoted\r\n              string\"\"\"\r\n```\r\nExpected javascript\r\n```javascript\r\n(function() {\r\n  return \"multi line\\ntriple\\nquoted\\nstring\";\r\n});\r\n```\r\ndecaffeinate 2.10.0\r\n```es6\r\n() =>\r\n    `multi line\r\n              triple\\nquoted\r\n              string`\r\n;\r\n```\r\ndecaffeinate on this branch\r\n```\r\n() => `multi line\\ntriple\\nquoted\\nstring`;\r\n```\r\n\r\nBased on the above, a few questions.\r\n1. Before going on to fixing the newly broken tests, Is converting the multi line strings in this way sensible?\r\n2. There is some nasty code in the StringPatcher (see patch method) any thoughts on how to make this better? "},"comment":{"url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/comments/219433388","html_url":"https://github.com/decaffeinate/decaffeinate/pull/224#issuecomment-219433388","issue_url":"https://api.github.com/repos/decaffeinate/decaffeinate/issues/224","id":219433388,"user":{"login":"madskonradsen","id":1265787,"avatar_url":"https://avatars.githubusercontent.com/u/1265787?v=3","gravatar_id":"","url":"https://api.github.com/users/madskonradsen","html_url":"https://github.com/madskonradsen","followers_url":"https://api.github.com/users/madskonradsen/followers","following_url":"https://api.github.com/users/madskonradsen/following{/other_user}","gists_url":"https://api.github.com/users/madskonradsen/gists{/gist_id}","starred_url":"https://api.github.com/users/madskonradsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/madskonradsen/subscriptions","organizations_url":"https://api.github.com/users/madskonradsen/orgs","repos_url":"https://api.github.com/users/madskonradsen/repos","events_url":"https://api.github.com/users/madskonradsen/events{/privacy}","received_events_url":"https://api.github.com/users/madskonradsen/received_events","type":"User","site_admin":false},"created_at":"2016-05-16T14:06:08Z","updated_at":"2016-05-16T14:06:08Z","body":"You're right, the coffeescript version is nicer! It's just that I have a lot of 20-30+ lines-coffeescript-strings(Angular templates) and it would mess stuff like that up if they got compiled into one line with \\n's :P In that case it would be preferable to keep the line breaks and just remove the indentation."}}