Im trying to generate the following HTML from scalatags:
<h3>There were orders found in <a href="#somewhere">somewhere </a> and <a href="#somewhereelse">somewhere else </a> </h3>
So far my attempt using the following in scalatags has not worked:
h3("There were orders found in" + a(href:="#somewhere")("somewhere") + "and" + a(href:="#somewhereelse")("somewhere else"))
h3("There were orders found in ", a(href:="#somewhere", "somewhere"),
" and ", a(href:="#somewhereelse", "somewhere else"))
This is how the structure would be in XML:
- <h3>
- TEXT
- <a>
- TEXT
- TEXT
- <a>
- TEXT
If you try and stick to writing your scalatags code the same way it would be structured in XML, it should come out OK. Also remember that in scalatags you intersperse attributse (... := ...
) and children; scalatags figures out which is which.