on 8fbfbce help sign in
elk/core-js/String.js
22 lines 514 B history raw
1var String = function() {
2 var properEscape = function(str) {
3 str.replace('"', """);
4 str.replace("&", "&");
5 str.replace("'", "'");
6 str.replace("<", "&#60;");
7 str.replace(">", "&#62;");
8 return str;
9 };
11 var toText = function(elmList) {
12 var a = [];
13 while (elmList[0] === "Cons") {
14 a.push(elmList[1]);
15 elmList = elmList[2];
16 }
17 return String.properEscape(a.join(''));
18 };
20 return {toText : toText,
21 properEscape : properEscape };
22}();