Closed lihaoyi closed 5 years ago
This also fails on a much simpler case. Note the classes "red" and "yellow" are concatenated into "redyellow".
scsmac081:scalatags bwbecker$ /usr/local/Cellar/scala/2.11.8/bin/scala
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_102).
Type in expressions for evaluation. Or try :help.
scala> :require /Users/bwbecker/.ivy2/cache/com.lihaoyi/scalatags_2.11/jars/scalatags_2.11-0.6.1.jar
Added '/Users/bwbecker/.ivy2/cache/com.lihaoyi/scalatags_2.11/jars/scalatags_2.11-0.6.1.jar' to classpath.
scala> import scalatags.Text.all._
import scalatags.Text.all._
scala> div(cls := "red", cls := "yellow")
res0: scalatags.Text.TypedTag[String] = <div class="redyellow"></div>
This is still an issue in 0.6.7 (and I just got bit by it again):
belser:scalatags bwbecker$ /usr/local/Cellar/scala/2.12.4/bin/scala
Welcome to Scala 2.12.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121).
Type in expressions for evaluation. Or try :help.
scala> :require /Users/bwbecker/.ivy2/cache/com.lihaoyi/scalatags_2.12/jars/scalatags_2.12-0.6.7.jar
Added '/Users/bwbecker/.ivy2/cache/com.lihaoyi/scalatags_2.12/jars/scalatags_2.12-0.6.7.jar' to classpath.
scala> import scalatags.Text.all._
import scalatags.Text.all._
scala> div()
res0: scalatags.Text.TypedTag[String] = <div></div>
scala> div(cls := "red", cls := "yellow")
res1: scalatags.Text.TypedTag[String] = <div class="redyellow"></div>
In the last line it should be <div class="red yellow"></div>
-- needs a space.
Pull request #152 fixes it...
For some reason, if the stylesheet class is applied before the manual class, the output is borked. The other way around works just fine. This should be fixed