Moodle

When writing a web address in plain text, it will translate it to a <a> element with the parameter "target" which is not allowed in XHTML 1.0 Strict

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Won't Fix
  • Affects Version/s: 1.9.3
  • Fix Version/s: None
  • Component/s: Accessibility, Resource
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE

Description

If I write for example:

"Lets go to Moodle (http://moodle.org)."

and use the format option "Moodle auto-format", then the web address will be translated to:

<a href="http://moodle.org" target="_blank">http://moodle.org</a>

Notice the "target" parameter which is not allowed by XHTML 1.0 Strict.

I think the default behavior should be to strip the target parameter and to just let it open in the same window.

This issue has also been tested in the current http://demo.moodle.org/

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

I think we need some general solution for this, achieving:

  • accessibility
  • functionality

I think one possible approach I've seen working is to add some CSS class to the link, and then, once the page is loaded, post-process it with a JS creating the proper targets.

I'm sure I've used that in some project... but I cannot remember where... shouldn't be difficult and could be applied to the Moodle format, the HTML Editor and other places (links to Docs...).

Show
Eloy Lafuente (stronk7) added a comment - I think we need some general solution for this, achieving:
  • accessibility
  • functionality
I think one possible approach I've seen working is to add some CSS class to the link, and then, once the page is loaded, post-process it with a JS creating the proper targets. I'm sure I've used that in some project... but I cannot remember where... shouldn't be difficult and could be applied to the Moodle format, the HTML Editor and other places (links to Docs...).
Hide
David Horat added a comment -

Hello Eloy.

If you mean processing it in the client side after the page is already wrong, I think it is not a good approach. This should be changed in the client side while creating the text before uploading it to the server. In the worst case it should be changed in the server before storing the information. But never try to solve it in the client side because of a wrong content stored in the server.

Regards,
David

Show
David Horat added a comment - Hello Eloy. If you mean processing it in the client side after the page is already wrong, I think it is not a good approach. This should be changed in the client side while creating the text before uploading it to the server. In the worst case it should be changed in the server before storing the information. But never try to solve it in the client side because of a wrong content stored in the server. Regards, David
Hide
Tim Hunt added a comment -

See MDL-17922 for implementing Eloy's suggestion.

Show
Tim Hunt added a comment - See MDL-17922 for implementing Eloy's suggestion.
Hide
David Horat added a comment - - edited

That could be a good idea because it makes the page accessible, it gets functional with the javascript and in case of not having javascript available, the page will keep on working correctly but opened in the same page (I just tested it).

Show
David Horat added a comment - - edited That could be a good idea because it makes the page accessible, it gets functional with the javascript and in case of not having javascript available, the page will keep on working correctly but opened in the same page (I just tested it).
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Michael de Raadt added a comment -

I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

Show
Michael de Raadt added a comment - I'm closing this issue as it appears to have become inactive and is probably not relevant to a current supported version. If you are encountering this problem or one similar, please launch a new issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: