on 096ff99 help sign in
elk/core-js/String.js
23 lines 567 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 if (typeof elmList === "string") return elmList;
13 var a = [];
14 while (elmList[0] === "Cons") {
15 a.push(elmList[1]);
16 elmList = elmList[2];
17 }
18 return String.properEscape(a.join(''));
19 };
21 return {toText : toText,
22 properEscape : properEscape };
23}();