When I used "<nolink>" at the first level menu item, the item rendered is like this:

<strong>Information href="#" href="#"</strong> ("Information" is the text I used on that menu item).

I found that he HTML generated is messed up as below:

<li class="expanded no link">
<a href="#" title="">Information href="#"</a> href="#"
...

Comments

gagarine’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Active » Postponed (maintainer needs more info)

Need to see if the problem is still present on 2.x

metakel’s picture

it is still the same at 7.x-2.x-dev when using <nolink>

The HTML rendered is as below, making the href="#" code visible to user (note the end of the second line below):

<li class="expanded">
  <a href="#" title="">Menu item</a> href="#"
  <ul>
    <li class="first leaf">
      <a href="/somewhere">First submenu item</a>
    </li>
...
...
gagarine’s picture

Category: bug » feature
Status: Postponed (maintainer needs more info) » Active

Please can you check than in admin/config/system/special_menu_items you only specify tag but not tag with attributes.

This is ok <a> but this is not <a href='#'>.

Perhaps we can improve the regex to make it works or find some other way.

gagarine’s picture

Title: "href" rendered in wrong position when <nolink> » Tag attributes are present in closing tag
Status: Active » Fixed

Ok now it will works. https://drupal.org/commitlog/commit/9840/1a4eef8bda963929617c094f2a418d6...

But if attribute are send by other modules, it will not merge them so you will have duplicate. I'm not sure it's even possible to do that.

EDIT: I remove the regex https://drupal.org/commitlog/commit/9840/068cbab123118e3311de4fecd10a333.... Regex didn't make sens to split a string on the first space...

metakel’s picture

Do you mean that we should replace the special_menu_items.module file with the above #4 GIT committed one (first link)?

If so, it seems that the "<nolink>" option does not work after replacement. When clicking the menu item filled with <nolink>, the below message is shown (a 404 not found).

The requested page "/%3Cnolink%3E" could not be found.
metakel’s picture

I have just tried the 7.x-2.x-dev, dated 2012-Sep-03. The problem seems fixed. Thank you!!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Changed: "When I used '' at the first level" ... to "When I used at the first level..." because suddenly realised that the code is hidden by the system.