Issue Details (XML | Word | Printable)

Key: MDL-17701
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: moodle.com
Reporter: David Horat
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
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

Created: 20/Dec/08 01:02 AM   Updated: 16/Jan/09 06:34 PM
Return to search
Component/s: Accessibility, Resource
Affects Version/s: 1.9.3
Fix Version/s: None

Issue Links:
Dependency
 
Relates
 

Participants: David Horat, Eloy Lafuente (stronk7), moodle.com and Tim Hunt
Security Level: None
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
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&lt;/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/

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Eloy Lafuente (stronk7) added a comment - 16/Jan/09 09:35 AM
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...).


David Horat added a comment - 16/Jan/09 09:52 AM
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


Tim Hunt added a comment - 16/Jan/09 09:56 AM
See MDL-17922 for implementing Eloy's suggestion.

David Horat added a comment - 16/Jan/09 10:11 AM - 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).