Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSX: Respect original spacing and newlines better #336

Merged
merged 1 commit into from
Sep 20, 2013

Commits on Sep 11, 2013

  1. JSX: Respect original spacing and newlines better

    Fixes facebook#335.
    
    Now this JSX:
    
    ```
    /** @jsx React.DOM */
    var HelloMessage = React.createClass({
      render: function() {
        return <div>
          Look!
          <a href=
            "http://www.facebook.com/">Facebook
          </a>
        </div>;
      }
    });
    ```
    
    produces
    
    ```
    /** @jsx React.DOM */
    var HelloMessage = React.createClass({displayName: 'HelloMessage',
      render: function() {
        return React.DOM.div(null,
          " Look! ",
          React.DOM.a( {href:
            "http://www.facebook.com/"}, "Facebook "
          )
        );
      }
    });
    ```
    
    rather than the less-desirable
    
    ```
    /** @jsx React.DOM */
    var HelloMessage = React.createClass({displayName: 'HelloMessage',
      render: function() {
        return React.DOM.div(null,
    " Look! ",      React.DOM.a( {href:"http://www.facebook.com/"}, "Facebook "      ),
        );
      }
    });
    ```
    sophiebits committed Sep 11, 2013
    Configuration menu
    Copy the full SHA
    f69112c View commit details
    Browse the repository at this point in the history