{"action":"created","issue":{"url":"https://api.github.com/repos/htacg/tidy-html5/issues/228","labels_url":"https://api.github.com/repos/htacg/tidy-html5/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/htacg/tidy-html5/issues/228/comments","events_url":"https://api.github.com/repos/htacg/tidy-html5/issues/228/events","html_url":"https://github.com/htacg/tidy-html5/pull/228","id":94634499,"number":228,"title":"vertical-space no means no vertical space","user":{"login":"nokome","id":1152336,"avatar_url":"https://avatars.githubusercontent.com/u/1152336?v=3","gravatar_id":"","url":"https://api.github.com/users/nokome","html_url":"https://github.com/nokome","followers_url":"https://api.github.com/users/nokome/followers","following_url":"https://api.github.com/users/nokome/following{/other_user}","gists_url":"https://api.github.com/users/nokome/gists{/gist_id}","starred_url":"https://api.github.com/users/nokome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nokome/subscriptions","organizations_url":"https://api.github.com/users/nokome/orgs","repos_url":"https://api.github.com/users/nokome/repos","events_url":"https://api.github.com/users/nokome/events{/privacy}","received_events_url":"https://api.github.com/users/nokome/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/htacg/tidy-html5/labels/Feature","name":"Feature","color":"02e10c"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/htacg/tidy-html5/milestones/6","html_url":"https://github.com/htacg/tidy-html5/milestones/5.1","labels_url":"https://api.github.com/repos/htacg/tidy-html5/milestones/6/labels","id":1030807,"number":6,"title":"5.1","description":"Next release","creator":{"login":"geoffmcl","id":1333435,"avatar_url":"https://avatars.githubusercontent.com/u/1333435?v=3","gravatar_id":"","url":"https://api.github.com/users/geoffmcl","html_url":"https://github.com/geoffmcl","followers_url":"https://api.github.com/users/geoffmcl/followers","following_url":"https://api.github.com/users/geoffmcl/following{/other_user}","gists_url":"https://api.github.com/users/geoffmcl/gists{/gist_id}","starred_url":"https://api.github.com/users/geoffmcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geoffmcl/subscriptions","organizations_url":"https://api.github.com/users/geoffmcl/orgs","repos_url":"https://api.github.com/users/geoffmcl/repos","events_url":"https://api.github.com/users/geoffmcl/events{/privacy}","received_events_url":"https://api.github.com/users/geoffmcl/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":3,"state":"open","created_at":"2015-03-20T11:30:55Z","updated_at":"2015-07-14T17:31:09Z","due_on":"2015-09-20T22:00:00Z","closed_at":null},"comments":5,"created_at":"2015-07-13T04:14:25Z","updated_at":"2015-07-14T19:43:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/htacg/tidy-html5/pulls/228","html_url":"https://github.com/htacg/tidy-html5/pull/228","diff_url":"https://github.com/htacg/tidy-html5/pull/228.diff","patch_url":"https://github.com/htacg/tidy-html5/pull/228.patch"},"body":"This is attempt to implement :\r\n\r\n> option to prevent outputting unnecessary vertical whitespace #163 (feature and pretty print) is a clear request that --vertical-space f mean almost NO vertical space ;=)) Sort of like a compact html stream - just one line\" \r\n\r\nwhich also addresses:\r\n\r\n> newlines inserted in pre tags #158 (feature and pretty print) is an old, OLD problem, still to be resolved\r\n\r\nSee htacg/tidy-html5#158, htacg/tidy-html5#163, htacg/tidy-html5#227.\r\n\r\nWith this, `--vertical-space no` outputs no new lines except those within pre, script and style tags (and possibly some others). Wrapping still applies, so if you really want no newlines then also specify `--wrap 0`. The default for  `vertical-space` has been changed to `yes` to be more similar to what it was (but really this might need to have a three level enum `none`, `classic`, `yes` to retain backwards compatibility). \r\n\r\nThe `vertical-space` option currently also applies to the start and end newlines referred to in #158. But if people want that as a separate option (i.e. vertical spacing but no extra new lines in pre etc) then it should be fairly easy to add. Let me know.\r\n\r\nThis has not been fully tested; some basic tests below.\r\n\r\nInput:\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n\t<head>\r\n\t\t<title>Flatland</title>\r\n\t\t<meta charset=\"utf-8\">\r\n\t</head>\r\n\t<body>\r\n\t\t<div><div>Some like it flat</div></div>\r\n\t\t<pre>I want my\r\n\t\t\tnewlines preserved.</pre>\r\n\t\t<style>\r\n\t\t\t.me.too {\r\n\t\t\t\tcolor: red;\r\n\t\t\t}\r\n\t\t</style>\r\n\t\t<script>I dont want any at all!</script>\r\n\t\t<p class=\"a long attribute that will get wrapped\">\r\n\t\t\tA long piece of text that will get wrapped.\r\n\t\t</p>\r\n\t</body>\r\n</html>\r\n```\r\n\r\n```sh\r\ntidy test.html\r\n```\r\n```html\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta name=\"generator\" content=\r\n\"HTML Tidy for HTML5 for Linux version 5.1.0.RC1\">\r\n<title>Flatland</title>\r\n<meta charset=\"utf-8\">\r\n</head>\r\n<body>\r\n<div>\r\n<div>Some like it flat</div>\r\n</div>\r\n\r\n<pre>\r\nI want my\r\n                        newlines preserved.\r\n</pre>\r\n<style>\r\n                        .me.too {\r\n                                color: red;\r\n                        }\r\n</style>\r\n<script>\r\nI dont want any at all!\r\n</script>\r\n<p class=\"a long attribute that will get wrapped\">A long piece of\r\ntext that will get wrapped.</p>\r\n</body>\r\n</html>\r\n```\r\n\r\n\r\n```sh\r\ntidy --vertical-space no --wrap 20 test.html\r\n```\r\n```html\r\n<!DOCTYPE html><html><head><meta name=\r\n\"generator\"\r\ncontent=\"HTML Tidy for HTML5 for Linux version 5.1.0.RC1\"><title>\r\nFlatland</title><meta charset=\r\n\"utf-8\"></head><body><div><div>Some like it\r\nflat</div></div><pre>I want my\r\n                        newlines preserved.</pre><style>                        .me.too {\r\n                                color: red;\r\n                        }\r\n</style><script>I dont want any at all!</script><p class=\r\n\"a long attribute that will get wrapped\">A long piece of\r\ntext that will get\r\nwrapped.</p></body></html>\r\n```\r\n\r\n\r\n```sh\r\ntidy --vertical-space no --wrap 0 test.html\r\n```\r\n```html\r\n<!DOCTYPE html><html><head><meta name=\"generator\" content=\"HTML Tidy for HTML5 for Linux version 5.1.0.RC1\"><title>Flatland</title><meta charset=\"utf-8\"></head><body><div><div>Some like it flat</div></div><pre>I want my\r\n                        newlines preserved.</pre><style>                        .me.too {\r\n                                color: red;\r\n                        }\r\n</style><script>I dont want any at all!</script><p class=\"a long attribute that will get wrapped\">A long piece of text that will get wrapped.</p></body></html>\r\n```"},"comment":{"url":"https://api.github.com/repos/htacg/tidy-html5/issues/comments/121353657","html_url":"https://github.com/htacg/tidy-html5/pull/228#issuecomment-121353657","issue_url":"https://api.github.com/repos/htacg/tidy-html5/issues/228","id":121353657,"user":{"login":"nokome","id":1152336,"avatar_url":"https://avatars.githubusercontent.com/u/1152336?v=3","gravatar_id":"","url":"https://api.github.com/users/nokome","html_url":"https://github.com/nokome","followers_url":"https://api.github.com/users/nokome/followers","following_url":"https://api.github.com/users/nokome/following{/other_user}","gists_url":"https://api.github.com/users/nokome/gists{/gist_id}","starred_url":"https://api.github.com/users/nokome/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nokome/subscriptions","organizations_url":"https://api.github.com/users/nokome/orgs","repos_url":"https://api.github.com/users/nokome/repos","events_url":"https://api.github.com/users/nokome/events{/privacy}","received_events_url":"https://api.github.com/users/nokome/received_events","type":"User","site_admin":false},"created_at":"2015-07-14T19:43:32Z","updated_at":"2015-07-14T19:43:32Z","body":"@geoffmcl , I am happy to defer to you, and backward compatibility, on this. I'll perhaps wait a few days in the hope of others chiming in, then take it forward."}}