Currently, this:
will be formatted like:
While the code in this example is invalid, leaving the unterminated string alone as best as possible makes the most sense.
There are currently no guarantees for invalid code, but this seems to be a reasonable guarantee. The formatter strives to format valid code and provide a best-effort on invalid code minimising the damage where possible.