We previously used different variants of that and moved away from it.
It's slow and full of inconsistencies across browsers.
On Nov 24, 1:37 am, disccomp discc...@gmail.com wrote:
How about this sweet little scripty I found[1], call it a textarea
hack:
function html_entity_decode(str) {
How about this sweet little scripty I found[1], call it a textarea
hack:
function html_entity_decode(str) {
var ta=document.createElement(textarea);
ta.innerHTML=str.replace(//g,lt;).replace(//g,gt;);
return ta.value;
}
[1]
Is it possible to manipulate the encoding of a string to convert HTML
entities? I'm trying to display the string in the title attribute of
an anchor. I'm using PJSON to get rss feeds from google's feed API, so
I have no ability to preprocess the data.
--
You received this message because you are
Tobie,
A correct character encoding should be all you really need to handle
such entities.
That's rather flip, don't you think? How does character encoding
choice solve quot; or nbsp;?
These entities are valid HTML, regardless of character encoding. There
are sometimes very good reasons for
Good point (and sorry if the tone of my earlier post came out wrong,
that wasn't my intention).
There's indeed a number of entities which are part of the HTL 4.01 spec
[1].
It's legitimate to want to be able to convert those, notably when
dealing with legacy or external content.
However, given
Thanks for your input.
A correct character encoding should be all you really need to handle
such entities.
Best,
Tobie
--
You received this message because you are subscribed to the Google Groups
Prototype: Core group.
To post to this group, send email to prototype-core@googlegroups.com
To