~canonical-sysadmins/wordpress/3.9.x

« back to all changes in this revision

Viewing changes to wp-includes/js/l10n.dev.js

  • Committer: Andrew Glen-Young
  • Date: 2011-03-08 14:47:51 UTC
  • Revision ID: andrew.glen-young@canonical.com-20110308144751-1n6spqgayztf9h77
[AGY] import 3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
}
 
 
b'\\ No newline at end of file'