```
def close = tagName collect { case name if name != "br" && name != "img" => HtmlTag(s"</$name>") }
```
Or probably better,
```
private val TagsNotToClose = Set("br", "img")
def close = tagName collect { case name if !TagsNotToClose(name) => HtmlTag(s"</$name>") }
```