Closed yousuketto closed 10 months ago
Oh, I didn't notice the document. As you say, it has to be changed as the following. Thanks.
* elseCall : whitespaceNoBreak? "else" whitespaceNoBreak? expressionPart
Furthermore, I noticed that elseIfCall has the same bug as elseCall. I'll fix it too.
@(b: Boolean, b2: Boolean)
x@if(b) {ifbody} <-whitespace
x@if(b) {ifbody} else if(b2) {elseifbody} <-whitespace
scala> com.github.yousuketto.txt.sample(true, false)
val res0: play.twirl.api.TxtFormat.Appendable =
xifbody <-whitespace
xifbody<-whitespace
scala> com.github.yousuketto.txt.sample(false, false)
val res1: play.twirl.api.TxtFormat.Appendable =
x <-whitespace
x<-whitespace
scala> com.github.yousuketto.txt.sample(false, true)
val res2: play.twirl.api.TxtFormat.Appendable =
x <-whitespace
xelseifbody<-whitespace
I also fixed a bug in elseIfCall. If we need to split this pull request, I'll split it. Please let me know.
Perfect, thanks!
@Mergifyio backport main
backport main
Thanks! This is now included in just released twirl 1.6.3 and 2.0.2
It's so helpful. Thanks for releasing.
The parser does not recognize whitespace after
else {...}
as a plain, so it is not showing.Refs #711