{"push_id":691580543,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"75bfbe9fec8ff4c594ac43a3312f5dae8574a504","before":"bfc76642604ab3c68eb1ebd661451e6ab5851989","commits":[{"sha":"75bfbe9fec8ff4c594ac43a3312f5dae8574a504","author":{"email":"521b71b66118ece0fda08843b612c77cfd6c2588@fb.com","name":"Jez Ng"},"message":"[hack] Format: Rewrite XHP tag handling\n\nSummary: This fixes a bunch of XHP tag ugliness. To achieve this, more context\ninformation was needed; in particular, we need to know whether we are\nformatting a self-closing tag or a paired tag right from the start.\n\nI also factored out a bunch of duplicated logic.\n\nResulting improvements:\n\n1. When printing a self-closing tag, we take into account the closing\n   `/>` in deciding whether it fits onto one line. Previously, we would\n   format the following ugliness:\n\n     <a href=\"foooooooooooo\"\n     />\n\n   instead of\n\n     <a\n       href=\"foooooooooooo\"\n     />\n\n2. Better heuristics for newline insertion / preservation in XHP\n\n* When we have a newline after a `>` or a `}`, we keep it. These\n  intentional newlines seem to be pretty common in flib/ui. In\n  particular, when we deal with block layout elements, the newlines\n  mirror how things are actually rendered:\n\n    <grid>\n      <item>hi</item>\n      <item>hi</item>\n    </grid>\n\n* When we have *no* newline nor space after a multiline XHP element, we\n  don't insert a newline. That is,\n\n    <span class='some long name'>\n      foo\n    </span>!\n\n  Should be rendered as-is.\n\nReviewed By: @jwatzman\n\nDifferential Revision: D2140721","distinct":true,"url":"https://api.github.com/repos/facebook/flow/commits/75bfbe9fec8ff4c594ac43a3312f5dae8574a504"}]}