]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-includes/js/l10n.dev.js
Wordpress 3.2.1
[autoinstalls/wordpress.git] / wp-includes / js / l10n.dev.js
1 //Used to ensure that Entities used in L10N strings are correct
2 function convertEntities(o) {
3         var c, v;
4         c = function(s) {
5                 if (/&[^;]+;/.test(s)) {
6                         var e = document.createElement("div");
7                         e.innerHTML = s;
8                         return !e.firstChild ? s : e.firstChild.nodeValue;
9                 }
10                 return s;
11         }
12
13         if ( typeof o === 'string' ) {
14                 return c(o);
15         } else if ( typeof o === 'object' ) {
16                 for (v in o) {
17                         if ( typeof o[v] === 'string' ) {
18                                 o[v] = c(o[v]);
19                         }
20                 }
21         }
22         return o;
23 }