{"action":"created","issue":{"url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/47","labels_url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/47/comments","events_url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/47/events","html_url":"https://github.com/jsdf/coffee-react-transform/issues/47","id":65099261,"number":47,"title":"Getting unexpected indentation errors while nesting tags and aligning tag attributes","user":{"login":"rmoorman","id":219695,"avatar_url":"https://avatars.githubusercontent.com/u/219695?v=3","gravatar_id":"","url":"https://api.github.com/users/rmoorman","html_url":"https://github.com/rmoorman","followers_url":"https://api.github.com/users/rmoorman/followers","following_url":"https://api.github.com/users/rmoorman/following{/other_user}","gists_url":"https://api.github.com/users/rmoorman/gists{/gist_id}","starred_url":"https://api.github.com/users/rmoorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmoorman/subscriptions","organizations_url":"https://api.github.com/users/rmoorman/orgs","repos_url":"https://api.github.com/users/rmoorman/repos","events_url":"https://api.github.com/users/rmoorman/events{/privacy}","received_events_url":"https://api.github.com/users/rmoorman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-29T21:36:53Z","updated_at":"2015-03-29T22:37:05Z","closed_at":null,"body":"Hi,\r\n\r\nI just ran into unexpected indentation errors while aligning tag attributes vertically within a cjsx file.\r\n\r\n````cjsx\r\nReact = require \"react\"\r\n\r\nExample = React.createClass\r\n  render: ->\r\n    <div\r\n      foo=\"bar\"\r\n      >\r\n      <div\r\n        bar=\"foo\"\r\n        >\r\n      </div>\r\n    </div>\r\n\r\nReact.render <Example />, document.getElementById \"app\"\r\n````\r\n\r\ngives me the following error: \r\n````\r\nunexpected indentation while parsing file: /path/to/js/app.cjsx\r\n````\r\nThis is while using it through `coffee-reactify`. Using the `cjsx` command line tool, however, shows an error too:\r\n````\r\n/path/to/js/app.cjsx:11:7: error: unexpected indentation\r\n      )\r\n      ^\r\n````\r\n\r\nTrying a by-hand-conversion of the example online with the [https://facebook.github.io/react/jsx-compiler.html](live react compiler):\r\n````jsx\r\nvar React = require(\"react\");\r\n\r\nvar Example = React.createClass({\r\n  render: function () {\r\n    <div\r\n      foo=\"bar\"\r\n      >\r\n      <div\r\n        bar=\"foo\"\r\n        >\r\n      </div>\r\n    </div>\r\n  }\r\n});\r\n\r\nReact.render(<Example />, document.getElementById(\"app\"));\r\n````\r\ndoes not reveal any errors so I guess it is not an error within jsx but within cjsx..\r\n\r\nAnd given the fact that all the grunt work of coffee-react is done by coffee-react-transform I presume this belongs here.\r\n\r\nAligning tag attributes like this makes the whole thing easier to read if things get more complicated (extra callbacks, several custom props a.s.o) and it would be great if this could be fixed!\r\n\r\nBest regards,\r\nRico Moorman\r\n\r\nVersion information:\r\n````\r\ncoffee-react version 3.0.1\r\ncoffee-react-transform version 3.0.1\r\ncoffee-script version 1.9.1\r\n````"},"comment":{"url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/comments/87491310","html_url":"https://github.com/jsdf/coffee-react-transform/issues/47#issuecomment-87491310","issue_url":"https://api.github.com/repos/jsdf/coffee-react-transform/issues/47","id":87491310,"user":{"login":"rmoorman","id":219695,"avatar_url":"https://avatars.githubusercontent.com/u/219695?v=3","gravatar_id":"","url":"https://api.github.com/users/rmoorman","html_url":"https://github.com/rmoorman","followers_url":"https://api.github.com/users/rmoorman/followers","following_url":"https://api.github.com/users/rmoorman/following{/other_user}","gists_url":"https://api.github.com/users/rmoorman/gists{/gist_id}","starred_url":"https://api.github.com/users/rmoorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmoorman/subscriptions","organizations_url":"https://api.github.com/users/rmoorman/orgs","repos_url":"https://api.github.com/users/rmoorman/repos","events_url":"https://api.github.com/users/rmoorman/events{/privacy}","received_events_url":"https://api.github.com/users/rmoorman/received_events","type":"User","site_admin":false},"created_at":"2015-03-29T22:37:05Z","updated_at":"2015-03-29T22:37:05Z","body":"Well, I can only see a few examples for self-closing tags (which makes sense, the end of the tag itself lines up with the beginning of the tag). Unfortunately there is no example of a tag with actual children. \r\n\r\nWhich kind of alignment is pretty and which is not is rather a matter of personal taste anyway. As for me it does not look that great, but it works. It is better than a compilation error as far as I am concerned :-)\r\nBut thank you for pointing that out.\r\n\r\nOn the other hand I think that it should work. But I can completely understand that it might not be top priority right now though."}}