{"action":"created","issue":{"url":"https://api.github.com/repos/atomicules/TTYtter/issues/20","labels_url":"https://api.github.com/repos/atomicules/TTYtter/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/atomicules/TTYtter/issues/20/comments","events_url":"https://api.github.com/repos/atomicules/TTYtter/issues/20/events","html_url":"https://github.com/atomicules/TTYtter/issues/20","id":113764826,"number":20,"title":"Replace newlines with spaces","user":{"login":"IvanSanchez","id":1125786,"avatar_url":"https://avatars.githubusercontent.com/u/1125786?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanSanchez","html_url":"https://github.com/IvanSanchez","followers_url":"https://api.github.com/users/IvanSanchez/followers","following_url":"https://api.github.com/users/IvanSanchez/following{/other_user}","gists_url":"https://api.github.com/users/IvanSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanSanchez/subscriptions","organizations_url":"https://api.github.com/users/IvanSanchez/orgs","repos_url":"https://api.github.com/users/IvanSanchez/repos","events_url":"https://api.github.com/users/IvanSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/IvanSanchez/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/atomicules/TTYtter/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/atomicules/TTYtter/labels/idea","name":"idea","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-28T08:12:59Z","updated_at":"2015-10-28T08:33:11Z","closed_at":null,"body":"Hi there,\r\n\r\nLittle feature request:\r\n\r\nI've started using the `-newline` option to get rid of `\\n` in my timeline. However, I personally find that using actual newlines in the output kinda breaks the flow of text.\r\n\r\nI have noticed the code always replaces `\\\\n` with `\\n` [around here](https://github.com/atomicules/TTYtter/blob/8ca7f0a2b7af50aa52964638ea48bc28c5b5dba7/ttytter.pl#L7585):\r\n\r\n```perl\r\n\tif ($newline) {\r\n\t\t$x =~ s/\\\\n/\\n/sg;\r\n\t\t$x =~ s/\\\\r//sg;\r\n\t}\r\n```\r\n\r\nIt would be great if there was a configurable way of replacing newlines with some other character or string, e.g. a space. Or a carriage return sign `␍`. Or a space-dash-space ` - `. Or a paragraph sign `¶` `§`. Or whatever. This would allow me to keep the text compact, separate URLs with a newline just after them, and notice where the author intended to put a newline."},"comment":{"url":"https://api.github.com/repos/atomicules/TTYtter/issues/comments/151764764","html_url":"https://github.com/atomicules/TTYtter/issues/20#issuecomment-151764764","issue_url":"https://api.github.com/repos/atomicules/TTYtter/issues/20","id":151764764,"user":{"login":"IvanSanchez","id":1125786,"avatar_url":"https://avatars.githubusercontent.com/u/1125786?v=3","gravatar_id":"","url":"https://api.github.com/users/IvanSanchez","html_url":"https://github.com/IvanSanchez","followers_url":"https://api.github.com/users/IvanSanchez/followers","following_url":"https://api.github.com/users/IvanSanchez/following{/other_user}","gists_url":"https://api.github.com/users/IvanSanchez/gists{/gist_id}","starred_url":"https://api.github.com/users/IvanSanchez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IvanSanchez/subscriptions","organizations_url":"https://api.github.com/users/IvanSanchez/orgs","repos_url":"https://api.github.com/users/IvanSanchez/repos","events_url":"https://api.github.com/users/IvanSanchez/events{/privacy}","received_events_url":"https://api.github.com/users/IvanSanchez/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T08:33:11Z","updated_at":"2015-10-28T08:33:11Z","body":"Yeah, maybe the same character that a newline is replaced by should trigger a newline when writing. Not sure. I'll be using a temporary solution in the meantime using replacement UTF8 characters:\r\n\r\n```perl\r\nuse utf8;\r\n```\r\n```perl\r\n\tif ($newline) {\r\n\t\tif ($seven) {\r\n\t\t\t$x =~ s/\\\\n/ [NL] /sg;\r\n\t\t\t$x =~ s/\\\\r/ [CR] /sg;\r\n\t\t} else {\r\n\t\t\t$x =~ s/\\\\n/ ␤ /sg;\r\n\t\t\t$x =~ s/\\\\r/ ␍ /sg;\r\n\t\t}\r\n\t}\r\n```\r\n\r\nLooks consistent IMHO (`␤` and `␍` are meant pretty much for this), but I don't have a (good) idea on how to compose tweets containing newlines."}}