Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#13427 closed defect (fixed)

dijit.Editor does not allow single quotes in an img alt attribute in IE

Reported by: philip Owned by: Jared Jurkiewicz
Priority: high Milestone: 1.8
Component: Editor Version: 1.6.0
Keywords: dijit.Editor img alt IE Cc:
Blocked By: Blocking:

Description

I believe there is an error in dijit._editor.getNodeHtml. In IE, it does not parse html that looks liks, <img alt="" src="..."/>

The single quotes inside the alt tag is legal HTML, but in IE, getNodeHtml turns this html into:

<img alt=""/>

I am attaching a test case that demonstrates the problem. If you run it with the IE developer tool you will see that the html written to the editor is not the same html that is read back.

If you write this to the editor,

var html = "<img alt=\"\" src=\"http://blogsearch.google.com/blogsearch/intl/en_ALL/images/blogs_logo.gif\">"; editor.set('value', html);

you will not be able to read it back in IE. It is fine in other browsers. I believe the regexp code in getNodeHtml makes the assumption that quotes and doublequotes are not nested inside each other.

Attachments (2)

dijit20.html (1.7 KB) - added by philip 8 years ago.
Test application that writes an <img> tag to the editor and reads it back. This does not work in IE.
13427.patch (5.1 KB) - added by Jared Jurkiewicz 8 years ago.
Patch for this issue.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by philip

Attachment: dijit20.html added

Test application that writes an <img> tag to the editor and reads it back. This does not work in IE.

comment:1 Changed 8 years ago by bill

Component: GeneralEditor

comment:2 Changed 8 years ago by philip

The single quotes got removed in the original post.

This html cannot be read back from dijit.Editor in IE:

      var html = "<img alt=\"''\" src=\"http://blogsearch.google.com/blogsearch/intl/en_ALL/images/blogs_logo.gif\">";
      editor.set('value', html);

Changed 8 years ago by Jared Jurkiewicz

Attachment: 13427.patch added

Patch for this issue.

comment:3 Changed 8 years ago by Jared Jurkiewicz

Owner: set to Jared Jurkiewicz
Resolution: fixed
Status: newclosed

In [27840]:

Fix issue with single quote values in IE alt attribute. \!strict fixes #13427

comment:4 Changed 8 years ago by Jared Jurkiewicz

Milestone: tbd1.8
Note: See TracTickets for help on using tickets.