framework
framework copied to clipboard
CSS selector transforms duplicate attributes when wrapping elements
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 = <div id="foo">content</div>
input: scala.xml.Elem = <div id="foo">content</div>
scala> val selector =
| "#foo" #> ((ns: xml.NodeSeq) => <wrapper>{ns}</wrapper>)
selector: net.liftweb.util.CssSel = // snip
scala> println(selector(input))
<wrapper id="foo"><div id="foo">content</div></wrapper>
You can see that wrapper is mistakenly getting an id attribute. The final output should be:
<wrapper><div id="foo">content</div></wrapper>
Imported from Assembla: http://www.assembla.com/spaces/liftweb/tickets/1114