Opened 10 years ago

Last modified 10 years ago

#10653 closed defect

[regression] InlineEditBox: error with special chars — at Version 9

Reported by: joshilay Owned by: Douglas Hays
Priority: high Milestone: 1.5
Component: Dijit Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

With dojo 1.4, InlineEditBox with an initial value containing special characters like < > & is not being displayed correctly. Instead page is showing &lt; etc.

Change History (11)

comment:1 Changed 10 years ago by Adam Peller

Milestone: 1.4.1tbd
Priority: highnormal
severity: majornormal

You'll need to give a little more detail, preferably with an example. Which code is not processing entities like &lt; ?

Changed 10 years ago by joshilay

Attachment: test.html added

test.html

comment:2 in reply to:  1 Changed 10 years ago by joshilay

Replying to peller:

You'll need to give a little more detail, preferably with an example. Which code is not processing entities like &lt; ?

I added a test case which shows with inline edit box embedded fonts are not working but outside it embedded fonts are working . I am using FF 3.5.7

comment:3 Changed 10 years ago by bill

Component: GeneralDijit
Milestone: tbd1.4.1
Owner: changed from anonymous to Douglas Hays
Summary: Error with dojo 1.4 embedded fonts like &lt;[regression] InlineEditBox: error with special chars

Thanks for attaching the test case. One key thing that you left out of your original report is that you were talking about dijit, and specifically about InlineEditBox. :-)

This worked in 1.3 and is broken in 1.4, starting with [20659]. Doug, can you look at this? Might be worth putting into 1.4.1.

comment:4 Changed 10 years ago by Douglas Hays

Resolution: invalid
Status: newclosed

In 1.3, the renderAsHtml flag defaulted to false but was being ignored. If you want the actual HTML entities to show on the page, then set renderAsHtml="true".

comment:5 Changed 10 years ago by Adam Peller

Milestone: 1.4.1tbd

comment:6 Changed 10 years ago by joshilay

Resolution: invalid
Status: closedreopened

comment:7 Changed 10 years ago by joshilay

By using renderAsHtml="true", inlineeditbox shows special characters like &lt; correctly but when user clicks on the inlineeditbox to edit text, it again shows "&lt;" instead of correct value.

comment:8 Changed 10 years ago by Douglas Hays

Resolution: invalid
Status: reopenedclosed

It is behaving correctly. The user should be able to enter:

this is <b>&lt;bold&gt;</b>

and the HTML will be rendered as
this is <bold>

comment:9 Changed 10 years ago by bill

Description: modified (diff)
Resolution: invalid
Status: closedreopened

This seems broken to me too.

renderAsHtml=true is inappropriate here, because that setting is for when the editor (ie: the widget shown when you click the InlineEditBox) handles HTML, which in practice means dijit.Editor. Since this test case is using the default dijit.TextBox editor, it should stick to the default renderAsHtml=false.

Saving in renderAsHtml=false mode is working correctly: the user can enter <foo> into the TextBox and when editing is finished it still shows up on the screen as <foo>.

However, the problem though is to specify an initial value of the InlineEditBox that contains special characters. How does a developer specify the initial value as <Inside Inline Edit Box>? I don't see any way. In any case, markup like this doesn't work in 1.4:

<span dojoType="dijit.InlineEditBox">
       &lt; Inside Inline Edit Box&gt;
</span>

That it worked in 1.3 and I think it makes sense.

Changed 10 years ago by Douglas Hays

Attachment: 10653.patch added

add initial value filtering if renderAsHtml=false, and created additional automated tests

Note: See TracTickets for help on using tickets.