UNPKG

789 BJavaScriptView Raw
1var h, text, yield, __cc;
2
3__cc = {
4 buffer: ""
5};
6
7text = function(txt) {
8 if (typeof txt === "string" || txt instanceof String) {
9 return __cc.buffer += txt;
10 } else {
11 if (typeof txt === "number" || txt instanceof Number) {
12 return __cc.buffer += String(txt);
13 }
14 }
15};
16
17h = function(txt) {
18 var escaped;
19 escaped = void 0;
20 if (typeof txt === "string" || txt instanceof String) {
21 escaped = txt.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
22 } else {
23 escaped = txt;
24 }
25 return escaped;
26};
27
28yield = function(f) {
29 var old_buffer, temp_buffer;
30 temp_buffer = "";
31 old_buffer = __cc.buffer;
32 __cc.buffer = temp_buffer;
33 f();
34 temp_buffer = __cc.buffer;
35 __cc.buffer = old_buffer;
36 return temp_buffer;
37};