Using Play Framework 2 I've noticed the rendered Scala HTML templates don't like indented @if
or @for
.
So, for example, something like that:
<ul>
@for(test <- tests) {
<li>@test.name</li>
}
</ul>
Will have extra unneeded spaces. To fix it, I need to do something like that:
<ul>
@for(test <- tests) {
<li>@test.name</li>
}
</ul>
Which will get messy with additional @defining
or other statements.
So, is there a way to prettify/beautify Scala templates rendering in order to get rid of extra white spaces?
UPDATE:
Reading this thread I've noticed extra spaces and line breaks are added as well because of the parameters on top of the templates. So this:
@(myParam: String)
<!DOCTYPE html>
<html>
<head></head>
<body></body>
</html>
will add 3 extra line breaks on top of the resulting HTML. Which is definitely annoying.
The thread seems to say there are no option at the moment to correct that.