{"action":"created","issue":{"url":"https://api.github.com/repos/nette/neon/issues/20","labels_url":"https://api.github.com/repos/nette/neon/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/nette/neon/issues/20/comments","events_url":"https://api.github.com/repos/nette/neon/issues/20/events","html_url":"https://github.com/nette/neon/issues/20","id":64565132,"number":20,"title":"Encoder generates unneeded indentation and new lines","user":{"login":"legendik","id":2327491,"avatar_url":"https://avatars.githubusercontent.com/u/2327491?v=3","gravatar_id":"","url":"https://api.github.com/users/legendik","html_url":"https://github.com/legendik","followers_url":"https://api.github.com/users/legendik/followers","following_url":"https://api.github.com/users/legendik/following{/other_user}","gists_url":"https://api.github.com/users/legendik/gists{/gist_id}","starred_url":"https://api.github.com/users/legendik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/legendik/subscriptions","organizations_url":"https://api.github.com/users/legendik/orgs","repos_url":"https://api.github.com/users/legendik/repos","events_url":"https://api.github.com/users/legendik/events{/privacy}","received_events_url":"https://api.github.com/users/legendik/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-26T15:56:26Z","updated_at":"2015-03-26T19:52:50Z","closed_at":"2015-03-26T18:08:26Z","body":"Let's have following `messagess.neon` file:\r\n```\r\na:\r\n\tb: Some text\r\n\tc: Some other text\r\n\td: someKey:\r\n\t\te: Some next message\r\nf: Hello world\r\n```\r\n\r\nWe want to parse this file by `Decoder`, the decoded values encode by `Encoder` and save the file back, because we want fix \"Neon coding standards\" in this file. Like remove unneeded `\"`,`'` etc...\r\n\r\nThe common problem is, that the `Encoder` properly fix the `Neon coding standards`, but generates also unneeded newlines and tabs.\r\n\r\nLet's have following code:\r\n\r\n```php\r\n$file = file_get_contents('messages.neon');\r\n$decoder = new Decoder;\r\n$decoded = $decoder->decode($file);\r\n$encoder = new Encoder;\r\n$encoded = $encoder->encode($decoded, Encoder::BLOCK);\r\nfile_put_contents('messages.neon', $encoded);\r\n```\r\n\r\nAnd the result of `messages.neon`?\r\n\r\n```\r\na:\r\n\tb: Some text\r\n\tc: Some other text\r\n\td: someKey:\r\n\t\te: Some next message\r\n\t\t#two tabs\r\n\t#one tab\r\nf: Hello world\r\n```"},"comment":{"url":"https://api.github.com/repos/nette/neon/issues/comments/86689297","html_url":"https://github.com/nette/neon/issues/20#issuecomment-86689297","issue_url":"https://api.github.com/repos/nette/neon/issues/20","id":86689297,"user":{"login":"dg","id":194960,"avatar_url":"https://avatars.githubusercontent.com/u/194960?v=3","gravatar_id":"","url":"https://api.github.com/users/dg","html_url":"https://github.com/dg","followers_url":"https://api.github.com/users/dg/followers","following_url":"https://api.github.com/users/dg/following{/other_user}","gists_url":"https://api.github.com/users/dg/gists{/gist_id}","starred_url":"https://api.github.com/users/dg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dg/subscriptions","organizations_url":"https://api.github.com/users/dg/orgs","repos_url":"https://api.github.com/users/dg/repos","events_url":"https://api.github.com/users/dg/events{/privacy}","received_events_url":"https://api.github.com/users/dg/received_events","type":"User","site_admin":false},"created_at":"2015-03-26T19:52:50Z","updated_at":"2015-03-26T19:52:50Z","body":"Fixed"}}