Skip to content
This repository
Browse code

Closes #1126. Swallows an inner <a> for Menu.item

  • Loading branch information...
commit c6746cbc455d21ea7ef0f70a92c0d87bf9f5568f 1 parent dff0b6a
David Pollak authored January 09, 2012
8  web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala
@@ -396,15 +396,21 @@ object Menu extends DispatchSnippet {
396 396
    * set the "donthide" attribute on the tag to force it to show text only (same text as normal,
397 397
    * but not in an anchor tag)</p>
398 398
    *
  399
+   *
399 400
    * <p>Alternatively, you can set the "linkToSelf" attribute to "true" to force a link. You
400 401
    * can specify your own link text with the tag's contents. Note that <b>case is significant</b>, so
401 402
    * make sure you specify "linkToSelf" and not "linktoself".</p>
402 403
    *
403 404
    */
404  
-  def item(text: NodeSeq): NodeSeq = {
  405
+  def item(_text: NodeSeq): NodeSeq = {
405 406
     val donthide = S.attr("donthide").map(Helpers.toBoolean) openOr false
406 407
     val linkToSelf = (S.attr("linkToSelf") or S.attr("linktoself")).map(Helpers.toBoolean) openOr false
407 408
 
  409
+    val text = ("a" #> ((n: NodeSeq) => n match {
  410
+      case e: Elem => e.child
  411
+      case xs => xs
  412
+    })).apply(_text)
  413
+
408 414
     for {
409 415
       name <- S.attr("name").toList
410 416
     } yield {

0 notes on commit c6746cb

Please sign in to comment.
Something went wrong with that request. Please try again.