twirl icon indicating copy to clipboard operation
twirl copied to clipboard

Why the generated text/html looks wired?

Open Jiakui opened this issue 10 years ago • 0 comments

I just used a very simple template below:

https://github.com/llinder/spray-twirl-bootstrap/blob/master/src/main/twirl/index.scala.html

or

<!DOCTYPE html>
<html>
<head>
    <title>Bootstrap 101 Template</title>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
</head>
<body>
<h1>Hello, world!</h1>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html> 

The text/html generated by the template looks like:

<!DOCTYPE html>\n<html>\n<head>\n    <title>Bootstrap 101 Template</title>\n    <!-- Bootstrap -->\n    <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\" media=\"screen\">\n</head>\n<body>\n<h1>Hello, world!</h1>\n<script src=\"http://code.jquery.com/jquery-latest.js\"></script>\n<script src=\"js/bootstrap.min.js\"></script>\n</body>\n</html>

The text/html doesn't display properly in the browser. Any ideas?

Thanks!

Jiakui avatar Mar 23 '15 16:03 Jiakui