Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If without an Else doesn't render #63

Open
dashkto opened this issue Oct 10, 2017 · 1 comment
Open

If without an Else doesn't render #63

dashkto opened this issue Oct 10, 2017 · 1 comment

Comments

@dashkto
Copy link

dashkto commented Oct 10, 2017

val a = scalatex.tw("@if(true){omg}").render.trim
val b = scalatex.tw("@if(true)\n    omg").render.trim
assert(a == b && a == "omg")

There are some tests cases which cover the parsing of these expressions into Ast.Block.IfElse which seem to work but they don't render and no test cases seem to cover the render step.

@dashkto
Copy link
Author

dashkto commented Oct 10, 2017

I'm working around it by putting the following in scope.

def if2(cond: Boolean)(frag: Frag) = if(cond) frag else stringFrag("")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant