We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f463b4 commit 45f55a4Copy full SHA for 45f55a4
k-template/parse.js
@@ -0,0 +1,35 @@
1
+/**
2
+ * support if else for while
3
+ */
4
+const AST = {}
5
+const ifRegExp =
6
7
+ * <ul {{% %}}
8
+ * <li for(var i = 0;i<3;i++){ >
9
+ *
10
+ * <{{% } %}}/li>
11
+ * </ul>
12
13
+
14
+function initString(){
15
16
+}
17
18
+function load(){
19
20
21
22
+function xssEscape(string) {
23
+ return [
24
+ ["&", "&"],
25
+ [" ", " "],
26
+ ["<", "<"],
27
+ [">", ">"],
28
+ ["\r\n", "<br/>"],
29
+ ["\n", "<br/>"],
30
+ ["\"", """],
31
+ ].reduce(
32
+ function(string, [pattern, replacement]) {
33
+ return string.replace(new RegExp(pattern, "g"), replacement);
34
+ }, string);
35
+ }
0 commit comments