{"action":"created","issue":{"url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/27","labels_url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/27/comments","events_url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/27/events","html_url":"https://github.com/hipchat/hipchat-cli/issues/27","id":53622533,"number":27,"title":"New lines not converted","user":{"login":"gpapin","id":3064311,"avatar_url":"https://avatars.githubusercontent.com/u/3064311?v=3","gravatar_id":"","url":"https://api.github.com/users/gpapin","html_url":"https://github.com/gpapin","followers_url":"https://api.github.com/users/gpapin/followers","following_url":"https://api.github.com/users/gpapin/following{/other_user}","gists_url":"https://api.github.com/users/gpapin/gists{/gist_id}","starred_url":"https://api.github.com/users/gpapin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpapin/subscriptions","organizations_url":"https://api.github.com/users/gpapin/orgs","repos_url":"https://api.github.com/users/gpapin/repos","events_url":"https://api.github.com/users/gpapin/events{/privacy}","received_events_url":"https://api.github.com/users/gpapin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-07T11:23:01Z","updated_at":"2015-06-02T13:06:46Z","closed_at":null,"body":"When sending message with new lines ( ```\\n``` ) the content is not completely cleared resulting on non valid json send, and you get this message back : \r\n\r\n```\r\n{\r\n  \"error\": {\r\n    \"code\": 400,\r\n    \"message\": \"The request body cannot be parsed as valid JSON: Invalid control character at: line 1 column 121 (char 121)\",\r\n    \"type\": \"Bad Request\"\r\n  }\r\n}\r\n```\r\nHere is a quick fix. Replace this block line 100 \r\n```\r\n# replace newlines with XHTML <br>\r\nif [ $FORMAT == 'html' ]; then\r\n    INPUT=$(echo -n \"${INPUT}\" | sed \"s/$/\\<br\\>/\")\r\n    INPUT=$(echo -n \"${INPUT}\" | tr '\\n' ' ')\r\nfi\r\n```"},"comment":{"url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/comments/107947764","html_url":"https://github.com/hipchat/hipchat-cli/issues/27#issuecomment-107947764","issue_url":"https://api.github.com/repos/hipchat/hipchat-cli/issues/27","id":107947764,"user":{"login":"sebaplaza","id":6557434,"avatar_url":"https://avatars.githubusercontent.com/u/6557434?v=3","gravatar_id":"","url":"https://api.github.com/users/sebaplaza","html_url":"https://github.com/sebaplaza","followers_url":"https://api.github.com/users/sebaplaza/followers","following_url":"https://api.github.com/users/sebaplaza/following{/other_user}","gists_url":"https://api.github.com/users/sebaplaza/gists{/gist_id}","starred_url":"https://api.github.com/users/sebaplaza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebaplaza/subscriptions","organizations_url":"https://api.github.com/users/sebaplaza/orgs","repos_url":"https://api.github.com/users/sebaplaza/repos","events_url":"https://api.github.com/users/sebaplaza/events{/privacy}","received_events_url":"https://api.github.com/users/sebaplaza/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T13:06:46Z","updated_at":"2015-06-02T13:06:46Z","body":"Alternative fix:\r\nINPUT=$(echo \"${INPUT}\" | sed 's/$/<br>/' |  tr -d '\\n\\r')"}}