Adding a span tag to main menu items Possible Duplicate:
  How do I insert a &lt;span&gt; &lt;/span&gt; tag inside the &lt;a&gt; &lt;/a&gt; tag on my main menu  




I tried the code found in How do I insert a &lt;span&gt; &lt;/span&gt; tag inside the &lt;a&gt; &lt;/a&gt; tag on my main menu, and I have a problem with it: while it does add the span tags, it also strips out the main menu's unordered list and classes. 

How do I add the span tags inside the main menu links while also keeping the unordered list and the list menu classes?
Try this, http://api.drupal.org/api/drupal/includes--theme.inc/function/theme_links/7:



function THEMENAME_links__system_MENUNAME_menu($variables) {
  $output = '';
  foreach ($variables['links'] as $link) {
    $output .= l('&lt;li' . drupal_attributes(array('class' =&gt; $class)) . '&gt;' .'&lt;span&gt;'. check_plain($link['title']) .'&lt;/span&gt;' . '&lt;/li&gt;', $link['href'], $link);
  }
  return $output;
}


Is the &lt;li&gt; inside the &lt;a&gt;?