assertFormat('<html><head><script>var x=1;</script></head></html>','<html>\n\n<head>\n <script>\n var x = 1;\n </script>\n</head>\n\n</html>');
assertFormat('<html><head><script>var x=1;</script></head></html>','<html>\n\n<head>\n <script>var x = 1;</script>\n</head>\n\n</html>');
assertFormat('<html><head><script>\nvar x=2;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 2;\n\n </script>\n</head>\n\n</html>');
assertFormat('<html><head><script>\nvar x=2;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 2;\n </script>\n</head>\n\n</html>');
assertFormat('<html><head>\n <script>\nvar x=3;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 3;\n\n </script>\n</head>\n\n</html>');
assertFormat('<html><head>\n <script>\nvar x=3;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 3;\n </script>\n</head>\n\n</html>');
assertFormat('<html><head>\n <script>\nvar x=4;\nconsole.log("Hi");\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 4;\n console.log("Hi");\n\n </script>\n</head>\n\n</html>');
assertFormat('<html><head>\n <script>\nvar x=4;\nconsole.log("Hi");\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 4;\n console.log("Hi");\n </script>\n</head>\n\n</html>');
assertFormat('<html><head>\n |<script>\nvar x=5;\n</script>|</head></html>','<html><head>\n <script>\n var x = 5;\n </script></head></html>');
assertFormat('<html><head>\n |<script>\nvar x=5;\n</script>|</head></html>','<html><head>\n <script>\n var x = 5;\n\n </script></head></html>');
assertFormat('<html>\n<head>\n <script>\nvar x = 0;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 0;\n\n </script>\n</head>\n\n</html>');
assertFormat('<html>\n<head>\n <script>\nvar x = 0;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 0;\n </script>\n</head>\n\n</html>');
assertFormat('<html><head><script>\nvar x=1;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 1;\n\n </script>\n</head>\n\n</html>\n',options);
assertFormat('<html><head><script>\nvar x=1;\n</script></head></html>','<html>\n\n<head>\n <script>\n var x = 1;\n </script>\n</head>\n\n</html>\n',options);