MSIE breaking nolink fix maybe (moodle 1.2.1)

MSIE breaking nolink fix maybe (moodle 1.2.1)

by Michael Penney -
Number of replies: 5

Hi! I noticed that when pages with nolink tags are opened in MSIE on windows via the html editor (version with Moodle 1.2.1), it converts the <nolink> tag to <nolink />, which then doesn't stop linking anymore;-(.

So on linke 146 of the Glossary's filter.php I changed

        preg_match_all('/<nolink>(.+?)<\/nolink>/is',$text,$list_of_excludes);

to

        preg_match_all('/<nolink \/>(.+?)<\/nolink \/>/is',$text,$list_of_excludes);

This seems to fix the problem. So with this change you type <nolink /> </noliink /> around terms you don't want autolinked and it will still work for folks who use MSIE and the editor.

If this hasn't been addressed in the latest version of Glossary, maybe it could be?

Thanks!

Michael

Average of ratings: -
In reply to Michael Penney

Re: MSIE breaking nolink fix maybe (moodle 1.2.1)

by Jeffery Watkins -

I think I am having this problem, but do not wuite understand the solution.

When I want a word NOT to be autolink, I currently type <nolink>WORD</nolink> in the wysiwyg editor.

When I do this, you can see the words <nolink> </nolink>.  I then tried typing it in the html editor and I get the <nolink />WORD</nolink /> tag instead... and it doesn't work.

So.... if I change the line mentioned above in the filter.php file, it should fix this problem?  And, if so, do I type <nolink></nolink> around the word, or <nolink /></nolink />?

Thanks!!!

In reply to Jeffery Watkins

Re: MSIE breaking nolink fix maybe (moodle 1.2.1)

by Tim Allen -
Type <nolink /></nolink /> for this hack.
In reply to Michael Penney

Re: MSIE breaking nolink fix maybe (moodle 1.2.1)

by Ricardo De la Garza -

The bug causing flash movies not shown on MSIE due to extra slash at tags end /> instead of only >

I have Moodle 1.4.2 installed. I made the change you made on:

line 146 of the Glossary's /mod/glossary/filter.php:

preg_match_all('/<nolink>(.+?)<\/nolink>/is',$text,$list_of_excludes);

to

preg_match_all('/<nolink \/ >(.+?)<\/nolink \/>/is',$text,$list_of_excludes);

I also made the change on Open /lib/editor/htmlarea.php

line 2143 and replace line:
html += closed ? " />" : ">";
with:
html += closed ? ">" : ">";

but still have the problem of not showing the embedded flash movies shown because the tags end with /> instead of just the >

Any suggestions to solve this bug?

In reply to Ricardo De la Garza

Re: MSIE breaking nolink fix maybe (moodle 1.2.1)

by Michael Penney -
The only sure fix I've found is to use the media plugin or turn off the editor altogether.

I posted over in the the filters forum a method of displaying different sized swfs using the media plugin.



In reply to Michael Penney

Re: MSIE breaking nolink fix maybe (moodle 1.2.1)

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Michael!

I am also confronted to the nuisance of MSIE's over-zealous "XHTML conversion" of the <nolink> </nolink> tags to <nolink /></nolink />.

The hack you suggest in your  10 June 2004 message does work but:

  1. it is rather annoying to have to convert by hand all the previously entered <nolink> </nolink> tags to <nolink /></nolink />;
  2. it has the unwelcome side effect of making all Glossary entry words appear as hyperlinks (this is because the Glossary entries are automatically provided with a <nolink> Entry</nolink> tag by Moodle, which is now no longer functional because of the hack!

I have found another workaround which does not entail editing any of the Moodle core files. Here it is. If you have to use the Moodle Richtext HTML editor for entering text (for example when entering a new Glossary entry):

  1. Type your text in the WYSIWYG mode.
  2. Go to HTML Source mode
  3. type the <nolink></nolink> tags where you want them
  4. DO NOT GO BACK to  WYSIWYG mode (if you do, MSIE will rewrite your <nolink> tags)
  5. Click on "Save Changes"... et voila!
  6. Unfortunately, however, if you have to Edit that Glossary definition later on, you will find when switching to WYSIWYG mode that your nolink tags have been rewritten (by MSIE), and you'll have to set them right once more...

This whole business is rather a nuisance anyway, and one can avoid it by switching from MSIE to a Mozilla browser.

On another note, I agree with Françoise Blin that Moodle is overdoing the automatic linking. There are a number of cases where in fact I would rather like NOLINK to be the default mode and to have to decide myself which words - or which parts of my documents - would be hyperlinked, rather than the reverse. One is never happy!

All the best,

Joseph_R