| 11 | }; |
| 12 | |
| 13 | var decodeHTMLEnt = function(s){ |
| 14 | s = s.replace(/&#(\d+);?/g, function (_, code) { |
| 15 | return String.fromCharCode(code); |
| 16 | }).replace(/&#[xX]([A-Fa-f0-9]+);?/g, function (_, hex) { |
| 17 | return String.fromCharCode(parseInt(hex, 16)); |
| 18 | }).replace(/&([^;\W]+;?)/g, function (m, e) { |
| 19 | var ee = e.replace(/;$/, ''); |
| 20 | var target = ENTITIES[e] || (e.match(/;$/) && ENTITIES[ee]); |
| 21 | if (typeof target === 'number') { |
| 22 | return String.fromCharCode(target); |
| 23 | }else if (typeof target === 'string') { |
| 24 | return target; |
| 25 | }else { |
| 26 | return m; |
| 27 | } |
| 28 | }) |
| 29 | return s; |
| 30 | }; |
| 31 | var _ = function (type, props, children, callback) { |
| 32 | var elem = null; |
| 33 | if (type === "text") { |