js/canvas2svg.js
function createNamedToNumberedLookup(items, radix) {
        var i, entity, lookup = {}, base10, base16;
        items = items.split(',');
        radix = radix || 10;
        // Map from named to numbered entities.
        for (i = 0; i < items.length; i += 2) {
            entity = '&' + items[i + 1] + ';';
            base10 = parseInt(items[i], radix);
            lookup[entity] = '&#'+base10+';';
        }
        //FF and IE need to create a regex from hex values ie &nbsp; == \xa0
        lookup["\\xa0"] = '&#160;';
        return lookup;
    }
function createNamedToNumberedLookup(items, radix) {
        var i, entity, lookup = {}, base10, base16;
        items = items.split(',');
        radix = radix || 10;
        // Map from named to numbered entities.
        for (i = 0; i < items.length; i += 2) {
            entity = '&' + items[i + 1] + ';';
            base10 = parseInt(items[i], radix);
            lookup[entity] = '&#'+base10+';';
        }
        //FF and IE need to create a regex from hex values ie &nbsp; == \xa0
        lookup["\\xa0"] = '&#160;';
        return lookup;
    }
function createNamedToNumberedLookup ( items , radix ) { var i , entity , lookup = { } , base10 , base16 ; items = items . split ( ',' ) ; radix = radix || 10 ; // Map from named to numbered entities. for ( i = 0 ; i < items . length ; i += 2 ) { entity = '&' + items [ i + 1 ] + ';' ; base10 = parseInt ( items [ i ] , radix ) ; lookup [ entity ] = '&#' + base10 + ';' ; } //FF and IE need to create a regex from hex values ie &nbsp; == \xa0 lookup [ "\\xa0" ] = '&#160;' ; return lookup ; }
helper function to map named to numbered entities
helper function to map named to numbered entities