PDA

View Full Version : html decode problem for single quote



amodg
27 Jan 2010, 6:36 AM
Hi,

I'm trying to decode the string

var myName = 'D& #39;Souza.';(Being this a html editor,I have added a space after '&' to avoid decoding as this post renders)
var mydata = Ext.util.Format.htmlDecode(myName);
alert(mydata);

I am still getting the same string. Am I missing something?

Thanks,
-Amod

simplessus
20 May 2010, 3:26 AM
Has anybody solved this ? I have the same problem.

Condor
20 May 2010, 3:41 AM
htmlDecode only changes <, >, " and &

You will have to replace them yourself using a RegExp or render the text to a hidden element and get the innerHTML.

ps. You can post HTML entities by using the noparse tag, e.g.
' will display as '

steffenk
20 May 2010, 3:51 AM
ps. You can post HTML entities by using the noparse tag, e.g.
' will display as '

you can put any tag inside like ' results in '