The classes rendered into the primary (and probably secondary) menu are unique for every item, which is illogical for a class in CSS. If at all, these should be IDs. Also, the same class is repeated again in the nested link, which adds unnecessary code, since a link within a list item can easily be targeted via CSS selectors.
So instead of
<ul class="links" id="navlist">
<li class="first menu-1-1-52"><a href="/drupalCVS/?q=test" title="" class="menu-1-1-52">test</a></li>
<li class="menu-1-2-52"><a href="/drupalCVS/?q=test2" title="" class="menu-1-2-52">test2</a></li>
<li class="last menu-1-3-52"><a href="/drupalCVS/?q=test3" title="" class="menu-1-3-52">test3</a></li>
</ul>
the output should be
<ul class="links" id="navlist">
<li class="first"><a href="/drupalCVS/?q=test" title="">test</a></li>
<li id="menu-1-2-52"><a href="/drupalCVS/?q=test2" title="">test2</a></li>
<li class="last"><a href="/drupalCVS/?q=test3" title="">test3</a></li>
</ul>
The first and last list items don't need even an ID, since within UL#navlist there will only be one item with class first and last respectively.
To target each link directly:
// link 1
UL#navlist LI.first A { css here; }
// link 2
UL#navlist LI#menu-1-2-52 A { css here; }
// link 3
UL#navlist LI.last A { css here; }
The worst part is that this doesn't seem to be themable. Only the attributes of the UL element are accessible via theme('links', $primary_links), as far as I can see, so one is stuck with the bloated markup.
Comments
Comment #1
flevour commentedHi, can you still reproduce this bug? Were you using core themes or custom ones?
Cheers,
flevour
Comment #2
dpearcefl commentedConsidering the age of this issue with no responses and that D5 is unsupported, I am closing this issue.