com-lihaoyi / scalatags

ScalaTags is a small XML/HTML construction library for Scala.
https://com-lihaoyi.github.io/scalatags/
MIT License
758 stars 117 forks source link

Title should also be available as a Tag not only an Attribute #158

Closed ghost closed 7 years ago

ghost commented 7 years ago

title as tag is basically a tooltip for an element.

I was trying to change the title of the page, but head(title("Test")) would not work as title is only an attribute, hence correct syntax to compile would be head(title := "Test") but that renders to <head title="Test"> while <head><title>"Test"</title></head> is what is needed to render a website title.

I am not sure how it was managed to render the title here: http://www.lihaoyi.com/scalatags/, but I could not find a way so far and the docs do not help me here.

In any case Tags does not have a title in it and trying to create my own trait with values proved to be not working so far.

ghost commented 7 years ago

This is in Tags2 which needs special import -.-