lift / lift/framework

CSS selector transforms duplicate attributes when wrapping elements

Open
#1,114 1 comment 0 reactions 1 assignee Claimed by @Shadowfiend View on GitHub
CSS Selector Transforms P:Normal T:Defect
Dominant language
Scala
Stars
1.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

See thread at http://groups.google.com/group/liftweb/browse_thread/thread/184b7eb51d461b30

I've found what looks like another CSS selector bug. The selector is
appending the attributes of the input element to the attributes of the
root output element. This is especially problematic when on of those
attributes is id :-)

This is with lift-2.4-M4 and scala-2.9.1. From a console:

```
scala> import net.liftweb.util.Helpers._
import net.liftweb.util.Helpers._
scala> val input =

content

input: scala.xml.Elem =
content

scala> val selector =
| "#foo" #> ((ns: xml.NodeSeq) => {ns})
selector: net.liftweb.util.CssSel = // snip
scala> println(selector(input))
content

```

You can see that wrapper is mistakenly getting an id attribute. The
final output should be:

``` html

content

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.