Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit c6746cbc455d21ea7ef0f70a92c0d87bf9f5568f 1 parent dff0b6a
David Pollak dpp authored
8 web/webkit/src/main/scala/net/liftweb/builtin/snippet/Menu.scala
View
@@ -396,15 +396,21 @@ object Menu extends DispatchSnippet {
* set the "donthide" attribute on the tag to force it to show text only (same text as normal,
* but not in an anchor tag)</p>
*
+ *
* <p>Alternatively, you can set the "linkToSelf" attribute to "true" to force a link. You
* can specify your own link text with the tag's contents. Note that <b>case is significant</b>, so
* make sure you specify "linkToSelf" and not "linktoself".</p>
*
*/
- def item(text: NodeSeq): NodeSeq = {
+ def item(_text: NodeSeq): NodeSeq = {
val donthide = S.attr("donthide").map(Helpers.toBoolean) openOr false
val linkToSelf = (S.attr("linkToSelf") or S.attr("linktoself")).map(Helpers.toBoolean) openOr false
+ val text = ("a" #> ((n: NodeSeq) => n match {
+ case e: Elem => e.child
+ case xs => xs
+ })).apply(_text)
+
for {
name <- S.attr("name").toList
} yield {
Please sign in to comment.
Something went wrong with that request. Please try again.