Scalatags tag / container that prints nothing

196 Views Asked by At

I have a website structure where I use functions to maximize code reuse. Sometimes I need a certain page to add more scripts or stylesheets to the head of the html page. The code below does what I want, except I'm forced to use a div or some other tag to contain the rest of the scalatags. I don't really want a random div tag in my document's head part. Is there some generic/empty tag I could use for this purpose? (tag("") makes a compilation error btw.)

import scalatags.Text.all._

class Temp {

  def document = html(
    head(
      script("some javascript"),
      extraScripts
    ),
    body(
      h1("A website")
    )
  )

  def extraScripts = div( // <-- This div is the part I want to change
    script("More scripts"),
    script("and what not")
  )

}
0

There are 0 best solutions below