Browse code

escape special xml chars

devnewton authored on 23/06/2016 18:48:04
Showing 3 changed files
... ...
@@ -14,6 +14,7 @@
14 14
         <fieldset>
15 15
             <legend>Input : </legend>
16 16
             <textarea id="input" rows="5" cols="80">
17
+C'est ├ža la puissance de <video><br/></video>!
17 18
 >o_/ 22:23:56 #5766f86ae4b00e368dfab8a3 [:bondour]
18 19
 2016/06/19#10:22:01 les <b>moules<</b>
19 20
 \_o< https://sauf.ca http://totoz.eu/ ftp://ftp.fr.debian.org/ <a><i> <a nofollow="plop" href="http://linuxfr.org"> <a href="http://linuxfr.org" nofollow target="_blank">plop</a>
... ...
@@ -44,36 +44,47 @@ p2c2 = (function() {
44 44
             return result;
45 45
          },
46 46
         peg$c1 = { type: "any", description: "any character" },
47
-        peg$c2 = "http",
48
-        peg$c3 = { type: "literal", value: "http", description: "\"http\"" },
49
-        peg$c4 = "s",
50
-        peg$c5 = { type: "literal", value: "s", description: "\"s\"" },
51
-        peg$c6 = "ftp",
52
-        peg$c7 = { type: "literal", value: "ftp", description: "\"ftp\"" },
53
-        peg$c8 = "://",
54
-        peg$c9 = { type: "literal", value: "://", description: "\"://\"" },
55
-        peg$c10 = /^[^ \t\r\n]/,
56
-        peg$c11 = { type: "class", value: "[^ \\t\\r\\n]", description: "[^ \\t\\r\\n]" },
57
-        peg$c12 = function(url) {return '<url>' + url + '</url>'},
58
-        peg$c13 = "\\_",
59
-        peg$c14 = { type: "literal", value: "\\_", description: "\"\\\\_\"" },
60
-        peg$c15 = "<",
61
-        peg$c16 = { type: "literal", value: "<", description: "\"<\"" },
62
-        peg$c17 = ">",
63
-        peg$c18 = { type: "literal", value: ">", description: "\">\"" },
64
-        peg$c19 = "_/",
65
-        peg$c20 = { type: "literal", value: "_/", description: "\"_/\"" },
66
-        peg$c21 = function() {return '<canard/>';},
67
-        peg$c22 = /^[oO0\xF4\xB0\xF8\xF2\xF3@]/,
68
-        peg$c23 = { type: "class", value: "[oO0\xF4\xB0\xF8\xF2\xF3@]", description: "[oO0\xF4\xB0\xF8\xF2\xF3@]" },
69
-        peg$c24 = function(tag) {
47
+        peg$c2 = "<",
48
+        peg$c3 = { type: "literal", value: "<", description: "\"<\"" },
49
+        peg$c4 = function() { return "&lt;"; },
50
+        peg$c5 = ">",
51
+        peg$c6 = { type: "literal", value: ">", description: "\">\"" },
52
+        peg$c7 = function() { return "&gt;"; },
53
+        peg$c8 = "&",
54
+        peg$c9 = { type: "literal", value: "&", description: "\"&\"" },
55
+        peg$c10 = function() { return "&amp;"; },
56
+        peg$c11 = "\"",
57
+        peg$c12 = { type: "literal", value: "\"", description: "\"\\\"\"" },
58
+        peg$c13 = function() { return "&quot;"; },
59
+        peg$c14 = "'",
60
+        peg$c15 = { type: "literal", value: "'", description: "\"'\"" },
61
+        peg$c16 = function() { return "&apos;"; },
62
+        peg$c17 = "http",
63
+        peg$c18 = { type: "literal", value: "http", description: "\"http\"" },
64
+        peg$c19 = "s",
65
+        peg$c20 = { type: "literal", value: "s", description: "\"s\"" },
66
+        peg$c21 = "ftp",
67
+        peg$c22 = { type: "literal", value: "ftp", description: "\"ftp\"" },
68
+        peg$c23 = "://",
69
+        peg$c24 = { type: "literal", value: "://", description: "\"://\"" },
70
+        peg$c25 = /^[^ \t\r\n]/,
71
+        peg$c26 = { type: "class", value: "[^ \\t\\r\\n]", description: "[^ \\t\\r\\n]" },
72
+        peg$c27 = function(protocol, url) { return [].concat('<url>', protocol, url.join(""), '</url>').join("");},
73
+        peg$c28 = "\\_",
74
+        peg$c29 = { type: "literal", value: "\\_", description: "\"\\\\_\"" },
75
+        peg$c30 = "_/",
76
+        peg$c31 = { type: "literal", value: "_/", description: "\"_/\"" },
77
+        peg$c32 = function() {return '<canard/>';},
78
+        peg$c33 = /^[oO0\xF4\xB0\xF8\xF2\xF3@]/,
79
+        peg$c34 = { type: "class", value: "[oO0\xF4\xB0\xF8\xF2\xF3@]", description: "[oO0\xF4\xB0\xF8\xF2\xF3@]" },
80
+        peg$c35 = function(tag) {
70 81
          	p2c2.tagStack.push(tag);
71 82
             console.log("push " + tag);
72 83
          	return "<" + tag + ">";
73 84
          },
74
-        peg$c25 = "</",
75
-        peg$c26 = { type: "literal", value: "</", description: "\"</\"" },
76
-        peg$c27 = function(tag) {
85
+        peg$c36 = "</",
86
+        peg$c37 = { type: "literal", value: "</", description: "\"</\"" },
87
+        peg$c38 = function(tag) {
77 88
          	var result = "";
78 89
          	for(;;) {
79 90
               var poppedTag = p2c2.tagStack.pop();
... ...
@@ -89,93 +100,92 @@ p2c2 = (function() {
89 100
             }
90 101
             return result;
91 102
          },
92
-        peg$c28 = "b",
93
-        peg$c29 = { type: "literal", value: "b", description: "\"b\"" },
94
-        peg$c30 = "i",
95
-        peg$c31 = { type: "literal", value: "i", description: "\"i\"" },
96
-        peg$c32 = "u",
97
-        peg$c33 = { type: "literal", value: "u", description: "\"u\"" },
98
-        peg$c34 = "tt",
99
-        peg$c35 = { type: "literal", value: "tt", description: "\"tt\"" },
100
-        peg$c36 = function() { return ""; },
101
-        peg$c37 = /^[A-Za-z]/,
102
-        peg$c38 = { type: "class", value: "[A-Za-z]", description: "[A-Za-z]" },
103
-        peg$c39 = /^[^>]/,
104
-        peg$c40 = { type: "class", value: "[^>]", description: "[^>]" },
105
-        peg$c41 = "<a",
106
-        peg$c42 = { type: "literal", value: "<a", description: "\"<a\"" },
107
-        peg$c43 = /^[^<]/,
108
-        peg$c44 = { type: "class", value: "[^<]", description: "[^<]" },
109
-        peg$c45 = "</a>",
110
-        peg$c46 = { type: "literal", value: "</a>", description: "\"</a>\"" },
111
-        peg$c47 = function(attributes) { 
103
+        peg$c39 = "b",
104
+        peg$c40 = { type: "literal", value: "b", description: "\"b\"" },
105
+        peg$c41 = "i",
106
+        peg$c42 = { type: "literal", value: "i", description: "\"i\"" },
107
+        peg$c43 = "u",
108
+        peg$c44 = { type: "literal", value: "u", description: "\"u\"" },
109
+        peg$c45 = "tt",
110
+        peg$c46 = { type: "literal", value: "tt", description: "\"tt\"" },
111
+        peg$c47 = function(tag) { return "&lt" + tag; + "&gt"; },
112
+        peg$c48 = function(tag) { return  "&lt/" + tag; + "&gt";; },
113
+        peg$c49 = /^[A-Za-z]/,
114
+        peg$c50 = { type: "class", value: "[A-Za-z]", description: "[A-Za-z]" },
115
+        peg$c51 = /^[^>]/,
116
+        peg$c52 = { type: "class", value: "[^>]", description: "[^>]" },
117
+        peg$c53 = "<a",
118
+        peg$c54 = { type: "literal", value: "<a", description: "\"<a\"" },
119
+        peg$c55 = /^[^<]/,
120
+        peg$c56 = { type: "class", value: "[^<]", description: "[^<]" },
121
+        peg$c57 = "</a>",
122
+        peg$c58 = { type: "literal", value: "</a>", description: "\"</a>\"" },
123
+        peg$c59 = function(attributes) { 
112 124
            if(attributes.href) {
113 125
               return "<url>" + attributes.href + "</url>";
114 126
            }
115 127
          },
116
-        peg$c48 = " ",
117
-        peg$c49 = { type: "literal", value: " ", description: "\" \"" },
118
-        peg$c50 = function(separator, attribute) { return attribute;},
119
-        peg$c51 = function(attributes) {  var result = {};
128
+        peg$c60 = " ",
129
+        peg$c61 = { type: "literal", value: " ", description: "\" \"" },
130
+        peg$c62 = function(separator, attribute) { return attribute;},
131
+        peg$c63 = function(attributes) {  var result = {};
120 132
          	for(var a in attributes) {
121 133
             	result[attributes[a].name] = attributes[a].value;
122 134
             }
123 135
          	return result;
124 136
          },
125
-        peg$c52 = /^[a-z]/,
126
-        peg$c53 = { type: "class", value: "[a-z]", description: "[a-z]" },
127
-        peg$c54 = "=\"",
128
-        peg$c55 = { type: "literal", value: "=\"", description: "\"=\\\"\"" },
129
-        peg$c56 = /^[^"]/,
130
-        peg$c57 = { type: "class", value: "[^\"]", description: "[^\"]" },
131
-        peg$c58 = "\"",
132
-        peg$c59 = { type: "literal", value: "\"", description: "\"\\\"\"" },
133
-        peg$c60 = function(name, value) {return value;},
134
-        peg$c61 = function(name, value) {return { name: name, value: value}},
135
-        peg$c62 = function(norloge) { return '<norloge>' + norloge +'</norloge>'},
136
-        peg$c63 = "/",
137
-        peg$c64 = { type: "literal", value: "/", description: "\"/\"" },
138
-        peg$c65 = function(y, ln) { return y + "/" + ln; },
139
-        peg$c66 = /^[0-9]/,
140
-        peg$c67 = { type: "class", value: "[0-9]", description: "[0-9]" },
141
-        peg$c68 = function(digits) { return digits.join(""); },
142
-        peg$c69 = "#",
143
-        peg$c70 = { type: "literal", value: "#", description: "\"#\"" },
144
-        peg$c71 = function(m, d, nn) { return m + "/" + d + "#" + nn; },
145
-        peg$c72 = /^[0-1]/,
146
-        peg$c73 = { type: "class", value: "[0-1]", description: "[0-1]" },
147
-        peg$c74 = function(first, last) { return first + last; },
148
-        peg$c75 = /^[0-3]/,
149
-        peg$c76 = { type: "class", value: "[0-3]", description: "[0-3]" },
150
-        peg$c77 = ":",
151
-        peg$c78 = { type: "literal", value: ":", description: "\":\"" },
152
-        peg$c79 = function(sn, s) { return sn + ":" + s; },
153
-        peg$c80 = function(h, m) { return h + ":" + m; },
154
-        peg$c81 = /^[0-2]/,
155
-        peg$c82 = { type: "class", value: "[0-2]", description: "[0-2]" },
156
-        peg$c83 = /^[0-5]/,
157
-        peg$c84 = { type: "class", value: "[0-5]", description: "[0-5]" },
158
-        peg$c85 = /^[a-zA-Z0-9_]/,
159
-        peg$c86 = { type: "class", value: "[a-zA-Z0-9_]", description: "[a-zA-Z0-9_]" },
160
-        peg$c87 = function(chars) { var norlogeId = chars.join("");
137
+        peg$c64 = /^[a-z]/,
138
+        peg$c65 = { type: "class", value: "[a-z]", description: "[a-z]" },
139
+        peg$c66 = "=\"",
140
+        peg$c67 = { type: "literal", value: "=\"", description: "\"=\\\"\"" },
141
+        peg$c68 = /^[^"]/,
142
+        peg$c69 = { type: "class", value: "[^\"]", description: "[^\"]" },
143
+        peg$c70 = function(name, value) {return value;},
144
+        peg$c71 = function(name, value) {return { name: name, value: value}},
145
+        peg$c72 = function(norloge) { return '<norloge>' + norloge +'</norloge>'},
146
+        peg$c73 = "/",
147
+        peg$c74 = { type: "literal", value: "/", description: "\"/\"" },
148
+        peg$c75 = function(y, ln) { return y + "/" + ln; },
149
+        peg$c76 = /^[0-9]/,
150
+        peg$c77 = { type: "class", value: "[0-9]", description: "[0-9]" },
151
+        peg$c78 = function(digits) { return digits.join(""); },
152
+        peg$c79 = "#",
153
+        peg$c80 = { type: "literal", value: "#", description: "\"#\"" },
154
+        peg$c81 = function(m, d, nn) { return m + "/" + d + "#" + nn; },
155
+        peg$c82 = /^[0-1]/,
156
+        peg$c83 = { type: "class", value: "[0-1]", description: "[0-1]" },
157
+        peg$c84 = function(first, last) { return first + last; },
158
+        peg$c85 = /^[0-3]/,
159
+        peg$c86 = { type: "class", value: "[0-3]", description: "[0-3]" },
160
+        peg$c87 = ":",
161
+        peg$c88 = { type: "literal", value: ":", description: "\":\"" },
162
+        peg$c89 = function(sn, s) { return sn + ":" + s; },
163
+        peg$c90 = function(h, m) { return h + ":" + m; },
164
+        peg$c91 = /^[0-2]/,
165
+        peg$c92 = { type: "class", value: "[0-2]", description: "[0-2]" },
166
+        peg$c93 = /^[0-5]/,
167
+        peg$c94 = { type: "class", value: "[0-5]", description: "[0-5]" },
168
+        peg$c95 = /^[a-zA-Z0-9_]/,
169
+        peg$c96 = { type: "class", value: "[a-zA-Z0-9_]", description: "[a-zA-Z0-9_]" },
170
+        peg$c97 = function(chars) { var norlogeId = chars.join("");
161 171
            return '<norloge-id>#' + norlogeId + '</norloge-id>';
162 172
            },
163
-        peg$c88 = /^[a-zA-Z0-9\-_]/,
164
-        peg$c89 = { type: "class", value: "[a-zA-Z0-9-_]", description: "[a-zA-Z0-9-_]" },
165
-        peg$c90 = /^[<[]/,
166
-        peg$c91 = { type: "class", value: "[<[]", description: "[<[]" },
167
-        peg$c92 = function(bigorno) { return [].concat('<bigorno>', bigorno,'</bigorno>').join("")},
168
-        peg$c93 = "[:",
169
-        peg$c94 = { type: "literal", value: "[:", description: "\"[:\"" },
170
-        peg$c95 = /^[^\]]/,
171
-        peg$c96 = { type: "class", value: "[^\\]]", description: "[^\\]]" },
172
-        peg$c97 = "]",
173
-        peg$c98 = { type: "literal", value: "]", description: "\"]\"" },
174
-        peg$c99 = function(first, totoz, third) { var totozId = totoz.join(""); 
173
+        peg$c98 = /^[a-zA-Z0-9\-_]/,
174
+        peg$c99 = { type: "class", value: "[a-zA-Z0-9-_]", description: "[a-zA-Z0-9-_]" },
175
+        peg$c100 = /^[<[]/,
176
+        peg$c101 = { type: "class", value: "[<[]", description: "[<[]" },
177
+        peg$c102 = function(bigorno) { return [].concat('<bigorno>', bigorno,'</bigorno>').join("")},
178
+        peg$c103 = "[:",
179
+        peg$c104 = { type: "literal", value: "[:", description: "\"[:\"" },
180
+        peg$c105 = /^[^\]]/,
181
+        peg$c106 = { type: "class", value: "[^\\]]", description: "[^\\]]" },
182
+        peg$c107 = "]",
183
+        peg$c108 = { type: "literal", value: "]", description: "\"]\"" },
184
+        peg$c109 = function(first, totoz, third) { var totozId = totoz.join(""); 
175 185
           return '<totoz>' + totozId + '</totoz>'; },
176
-        peg$c100 = /^[ \t\r\n]/,
177
-        peg$c101 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" },
178
-        peg$c102 = function() { return location().start.offset == 0; },
186
+        peg$c110 = /^[ \t\r\n]/,
187
+        peg$c111 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" },
188
+        peg$c112 = function() { return location().start.offset == 0; },
179 189
 
180 190
         peg$currPos          = 0,
181 191
         peg$savedPos         = 0,
... ...
@@ -396,16 +406,19 @@ p2c2 = (function() {
396 406
               if (s0 === peg$FAILED) {
397 407
                 s0 = peg$parseatag();
398 408
                 if (s0 === peg$FAILED) {
399
-                  s0 = peg$parseopentag();
409
+                  s0 = peg$parseopenTag();
400 410
                   if (s0 === peg$FAILED) {
401
-                    s0 = peg$parseclosetag();
411
+                    s0 = peg$parsecloseTag();
402 412
                     if (s0 === peg$FAILED) {
403
-                      if (input.length > peg$currPos) {
404
-                        s0 = input.charAt(peg$currPos);
405
-                        peg$currPos++;
406
-                      } else {
407
-                        s0 = peg$FAILED;
408
-                        if (peg$silentFails === 0) { peg$fail(peg$c1); }
413
+                      s0 = peg$parsexmlSpecialChar();
414
+                      if (s0 === peg$FAILED) {
415
+                        if (input.length > peg$currPos) {
416
+                          s0 = input.charAt(peg$currPos);
417
+                          peg$currPos++;
418
+                        } else {
419
+                          s0 = peg$FAILED;
420
+                          if (peg$silentFails === 0) { peg$fail(peg$c1); }
421
+                        }
409 422
                       }
410 423
                     }
411 424
                   }
... ...
@@ -419,27 +432,147 @@ p2c2 = (function() {
419 432
       return s0;
420 433
     }
421 434
 
435
+    function peg$parsexmlSpecialChar() {
436
+      var s0;
437
+
438
+      s0 = peg$parselt();
439
+      if (s0 === peg$FAILED) {
440
+        s0 = peg$parsegt();
441
+        if (s0 === peg$FAILED) {
442
+          s0 = peg$parseamp();
443
+          if (s0 === peg$FAILED) {
444
+            s0 = peg$parsequot();
445
+            if (s0 === peg$FAILED) {
446
+              s0 = peg$parseapos();
447
+            }
448
+          }
449
+        }
450
+      }
451
+
452
+      return s0;
453
+    }
454
+
455
+    function peg$parselt() {
456
+      var s0, s1;
457
+
458
+      s0 = peg$currPos;
459
+      if (input.charCodeAt(peg$currPos) === 60) {
460
+        s1 = peg$c2;
461
+        peg$currPos++;
462
+      } else {
463
+        s1 = peg$FAILED;
464
+        if (peg$silentFails === 0) { peg$fail(peg$c3); }
465
+      }
466
+      if (s1 !== peg$FAILED) {
467
+        peg$savedPos = s0;
468
+        s1 = peg$c4();
469
+      }
470
+      s0 = s1;
471
+
472
+      return s0;
473
+    }
474
+
475
+    function peg$parsegt() {
476
+      var s0, s1;
477
+
478
+      s0 = peg$currPos;
479
+      if (input.charCodeAt(peg$currPos) === 62) {
480
+        s1 = peg$c5;
481
+        peg$currPos++;
482
+      } else {
483
+        s1 = peg$FAILED;
484
+        if (peg$silentFails === 0) { peg$fail(peg$c6); }
485
+      }
486
+      if (s1 !== peg$FAILED) {
487
+        peg$savedPos = s0;
488
+        s1 = peg$c7();
489
+      }
490
+      s0 = s1;
491
+
492
+      return s0;
493
+    }
494
+
495
+    function peg$parseamp() {
496
+      var s0, s1;
497
+
498
+      s0 = peg$currPos;
499
+      if (input.charCodeAt(peg$currPos) === 38) {
500
+        s1 = peg$c8;
501
+        peg$currPos++;
502
+      } else {
503
+        s1 = peg$FAILED;
504
+        if (peg$silentFails === 0) { peg$fail(peg$c9); }
505
+      }
506
+      if (s1 !== peg$FAILED) {
507
+        peg$savedPos = s0;
508
+        s1 = peg$c10();
509
+      }
510
+      s0 = s1;
511
+
512
+      return s0;
513
+    }
514
+
515
+    function peg$parsequot() {
516
+      var s0, s1;
517
+
518
+      s0 = peg$currPos;
519
+      if (input.charCodeAt(peg$currPos) === 34) {
520
+        s1 = peg$c11;
521
+        peg$currPos++;
522
+      } else {
523
+        s1 = peg$FAILED;
524
+        if (peg$silentFails === 0) { peg$fail(peg$c12); }
525
+      }
526
+      if (s1 !== peg$FAILED) {
527
+        peg$savedPos = s0;
528
+        s1 = peg$c13();
529
+      }
530
+      s0 = s1;
531
+
532
+      return s0;
533
+    }
534
+
535
+    function peg$parseapos() {
536
+      var s0, s1;
537
+
538
+      s0 = peg$currPos;
539
+      if (input.charCodeAt(peg$currPos) === 39) {
540
+        s1 = peg$c14;
541
+        peg$currPos++;
542
+      } else {
543
+        s1 = peg$FAILED;
544
+        if (peg$silentFails === 0) { peg$fail(peg$c15); }
545
+      }
546
+      if (s1 !== peg$FAILED) {
547
+        peg$savedPos = s0;
548
+        s1 = peg$c16();
549
+      }
550
+      s0 = s1;
551
+
552
+      return s0;
553
+    }
554
+
422 555
     function peg$parseurl() {
423
-      var s0, s1, s2, s3, s4, s5, s6;
556
+      var s0, s1, s2, s3, s4, s5;
424 557
 
425 558
       s0 = peg$currPos;
426 559
       s1 = peg$currPos;
427 560
       s2 = peg$currPos;
428 561
       s3 = peg$currPos;
429
-      if (input.substr(peg$currPos, 4) === peg$c2) {
430
-        s4 = peg$c2;
562
+      if (input.substr(peg$currPos, 4) === peg$c17) {
563
+        s4 = peg$c17;
431 564
         peg$currPos += 4;
432 565
       } else {
433 566
         s4 = peg$FAILED;
434
-        if (peg$silentFails === 0) { peg$fail(peg$c3); }
567
+        if (peg$silentFails === 0) { peg$fail(peg$c18); }
435 568
       }
436 569
       if (s4 !== peg$FAILED) {
437 570
         if (input.charCodeAt(peg$currPos) === 115) {
438
-          s5 = peg$c4;
571
+          s5 = peg$c19;
439 572
           peg$currPos++;
440 573
         } else {
441 574
           s5 = peg$FAILED;
442
-          if (peg$silentFails === 0) { peg$fail(peg$c5); }
575
+          if (peg$silentFails === 0) { peg$fail(peg$c20); }
443 576
         }
444 577
         if (s5 === peg$FAILED) {
445 578
           s5 = null;
... ...
@@ -456,52 +589,25 @@ p2c2 = (function() {
456 589
         s3 = peg$FAILED;
457 590
       }
458 591
       if (s3 === peg$FAILED) {
459
-        if (input.substr(peg$currPos, 3) === peg$c6) {
460
-          s3 = peg$c6;
592
+        if (input.substr(peg$currPos, 3) === peg$c21) {
593
+          s3 = peg$c21;
461 594
           peg$currPos += 3;
462 595
         } else {
463 596
           s3 = peg$FAILED;
464
-          if (peg$silentFails === 0) { peg$fail(peg$c7); }
597
+          if (peg$silentFails === 0) { peg$fail(peg$c22); }
465 598
         }
466 599
       }
467 600
       if (s3 !== peg$FAILED) {
468
-        if (input.substr(peg$currPos, 3) === peg$c8) {
469
-          s4 = peg$c8;
601
+        if (input.substr(peg$currPos, 3) === peg$c23) {
602
+          s4 = peg$c23;
470 603
           peg$currPos += 3;
471 604
         } else {
472 605
           s4 = peg$FAILED;
473
-          if (peg$silentFails === 0) { peg$fail(peg$c9); }
606
+          if (peg$silentFails === 0) { peg$fail(peg$c24); }
474 607
         }
475 608
         if (s4 !== peg$FAILED) {
476
-          s5 = [];
477
-          if (peg$c10.test(input.charAt(peg$currPos))) {
478
-            s6 = input.charAt(peg$currPos);
479
-            peg$currPos++;
480
-          } else {
481
-            s6 = peg$FAILED;
482
-            if (peg$silentFails === 0) { peg$fail(peg$c11); }
483
-          }
484
-          if (s6 !== peg$FAILED) {
485
-            while (s6 !== peg$FAILED) {
486
-              s5.push(s6);
487
-              if (peg$c10.test(input.charAt(peg$currPos))) {
488
-                s6 = input.charAt(peg$currPos);
489
-                peg$currPos++;
490
-              } else {
491
-                s6 = peg$FAILED;
492
-                if (peg$silentFails === 0) { peg$fail(peg$c11); }
493
-              }
494
-            }
495
-          } else {
496
-            s5 = peg$FAILED;
497
-          }
498
-          if (s5 !== peg$FAILED) {
499
-            s3 = [s3, s4, s5];
500
-            s2 = s3;
501
-          } else {
502
-            peg$currPos = s2;
503
-            s2 = peg$FAILED;
504
-          }
609
+          s3 = [s3, s4];
610
+          s2 = s3;
505 611
         } else {
506 612
           peg$currPos = s2;
507 613
           s2 = peg$FAILED;
... ...
@@ -516,10 +622,46 @@ p2c2 = (function() {
516 622
         s1 = s2;
517 623
       }
518 624
       if (s1 !== peg$FAILED) {
519
-        peg$savedPos = s0;
520
-        s1 = peg$c12(s1);
625
+        s2 = [];
626
+        s3 = peg$parsexmlSpecialChar();
627
+        if (s3 === peg$FAILED) {
628
+          if (peg$c25.test(input.charAt(peg$currPos))) {
629
+            s3 = input.charAt(peg$currPos);
630
+            peg$currPos++;
631
+          } else {
632
+            s3 = peg$FAILED;
633
+            if (peg$silentFails === 0) { peg$fail(peg$c26); }
634
+          }
635
+        }
636
+        if (s3 !== peg$FAILED) {
637
+          while (s3 !== peg$FAILED) {
638
+            s2.push(s3);
639
+            s3 = peg$parsexmlSpecialChar();
640
+            if (s3 === peg$FAILED) {
641
+              if (peg$c25.test(input.charAt(peg$currPos))) {
642
+                s3 = input.charAt(peg$currPos);
643
+                peg$currPos++;
644
+              } else {
645
+                s3 = peg$FAILED;
646
+                if (peg$silentFails === 0) { peg$fail(peg$c26); }
647
+              }
648
+            }
649
+          }
650
+        } else {
651
+          s2 = peg$FAILED;
652
+        }
653
+        if (s2 !== peg$FAILED) {
654
+          peg$savedPos = s0;
655
+          s1 = peg$c27(s1, s2);
656
+          s0 = s1;
657
+        } else {
658
+          peg$currPos = s0;
659
+          s0 = peg$FAILED;
660
+        }
661
+      } else {
662
+        peg$currPos = s0;
663
+        s0 = peg$FAILED;
521 664
       }
522
-      s0 = s1;
523 665
 
524 666
       return s0;
525 667
     }
... ...
@@ -529,22 +671,22 @@ p2c2 = (function() {
529 671
 
530 672
       s0 = peg$currPos;
531 673
       s1 = peg$currPos;
532
-      if (input.substr(peg$currPos, 2) === peg$c13) {
533
-        s2 = peg$c13;
674
+      if (input.substr(peg$currPos, 2) === peg$c28) {
675
+        s2 = peg$c28;
534 676
         peg$currPos += 2;
535 677
       } else {
536 678
         s2 = peg$FAILED;
537
-        if (peg$silentFails === 0) { peg$fail(peg$c14); }
679
+        if (peg$silentFails === 0) { peg$fail(peg$c29); }
538 680
       }
539 681
       if (s2 !== peg$FAILED) {
540 682
         s3 = peg$parseteteCanard();
541 683
         if (s3 !== peg$FAILED) {
542 684
           if (input.charCodeAt(peg$currPos) === 60) {
543
-            s4 = peg$c15;
685
+            s4 = peg$c2;
544 686
             peg$currPos++;
545 687
           } else {
546 688
             s4 = peg$FAILED;
547
-            if (peg$silentFails === 0) { peg$fail(peg$c16); }
689
+            if (peg$silentFails === 0) { peg$fail(peg$c3); }
548 690
           }
549 691
           if (s4 !== peg$FAILED) {
550 692
             s2 = [s2, s3, s4];
... ...
@@ -564,21 +706,21 @@ p2c2 = (function() {
564 706
       if (s1 === peg$FAILED) {
565 707
         s1 = peg$currPos;
566 708
         if (input.charCodeAt(peg$currPos) === 62) {
567
-          s2 = peg$c17;
709
+          s2 = peg$c5;
568 710
           peg$currPos++;
569 711
         } else {
570 712
           s2 = peg$FAILED;
571
-          if (peg$silentFails === 0) { peg$fail(peg$c18); }
713
+          if (peg$silentFails === 0) { peg$fail(peg$c6); }
572 714
         }
573 715
         if (s2 !== peg$FAILED) {
574 716
           s3 = peg$parseteteCanard();
575 717
           if (s3 !== peg$FAILED) {
576
-            if (input.substr(peg$currPos, 2) === peg$c19) {
577
-              s4 = peg$c19;
718
+            if (input.substr(peg$currPos, 2) === peg$c30) {
719
+              s4 = peg$c30;
578 720
               peg$currPos += 2;
579 721
             } else {
580 722
               s4 = peg$FAILED;
581
-              if (peg$silentFails === 0) { peg$fail(peg$c20); }
723
+              if (peg$silentFails === 0) { peg$fail(peg$c31); }
582 724
             }
583 725
             if (s4 !== peg$FAILED) {
584 726
               s2 = [s2, s3, s4];
... ...
@@ -598,7 +740,7 @@ p2c2 = (function() {
598 740
       }
599 741
       if (s1 !== peg$FAILED) {
600 742
         peg$savedPos = s0;
601
-        s1 = peg$c21();
743
+        s1 = peg$c32();
602 744
       }
603 745
       s0 = s1;
604 746
 
... ...
@@ -608,52 +750,41 @@ p2c2 = (function() {
608 750
     function peg$parseteteCanard() {
609 751
       var s0;
610 752
 
611
-      if (peg$c22.test(input.charAt(peg$currPos))) {
753
+      if (peg$c33.test(input.charAt(peg$currPos))) {
612 754
         s0 = input.charAt(peg$currPos);
613 755
         peg$currPos++;
614 756
       } else {
615 757
         s0 = peg$FAILED;
616
-        if (peg$silentFails === 0) { peg$fail(peg$c23); }
617
-      }
618
-
619
-      return s0;
620
-    }
621
-
622
-    function peg$parseopentag() {
623
-      var s0;
624
-
625
-      s0 = peg$parsevalidOpenTag();
626
-      if (s0 === peg$FAILED) {
627
-        s0 = peg$parseinvalidOpenTag();
758
+        if (peg$silentFails === 0) { peg$fail(peg$c34); }
628 759
       }
629 760
 
630 761
       return s0;
631 762
     }
632 763
 
633
-    function peg$parsevalidOpenTag() {
764
+    function peg$parseopenTag() {
634 765
       var s0, s1, s2, s3;
635 766
 
636 767
       s0 = peg$currPos;
637 768
       if (input.charCodeAt(peg$currPos) === 60) {
638
-        s1 = peg$c15;
769
+        s1 = peg$c2;
639 770
         peg$currPos++;
640 771
       } else {
641 772
         s1 = peg$FAILED;
642
-        if (peg$silentFails === 0) { peg$fail(peg$c16); }
773
+        if (peg$silentFails === 0) { peg$fail(peg$c3); }
643 774
       }
644 775
       if (s1 !== peg$FAILED) {
645 776
         s2 = peg$parsevalidFormatTag();
646 777
         if (s2 !== peg$FAILED) {
647 778
           if (input.charCodeAt(peg$currPos) === 62) {
648
-            s3 = peg$c17;
779
+            s3 = peg$c5;
649 780
             peg$currPos++;
650 781
           } else {
651 782
             s3 = peg$FAILED;
652
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
783
+            if (peg$silentFails === 0) { peg$fail(peg$c6); }
653 784
           }
654 785
           if (s3 !== peg$FAILED) {
655 786
             peg$savedPos = s0;
656
-            s1 = peg$c24(s2);
787
+            s1 = peg$c35(s2);
657 788
             s0 = s1;
658 789
           } else {
659 790
             peg$currPos = s0;
... ...
@@ -671,41 +802,30 @@ p2c2 = (function() {
671 802
       return s0;
672 803
     }
673 804
 
674
-    function peg$parseclosetag() {
675
-      var s0;
676
-
677
-      s0 = peg$parsevalidCloseTag();
678
-      if (s0 === peg$FAILED) {
679
-        s0 = peg$parseinvalidCloseTag();
680
-      }
681
-
682
-      return s0;
683
-    }
684
-
685
-    function peg$parsevalidCloseTag() {
805
+    function peg$parsecloseTag() {
686 806
       var s0, s1, s2, s3;
687 807
 
688 808
       s0 = peg$currPos;
689
-      if (input.substr(peg$currPos, 2) === peg$c25) {
690
-        s1 = peg$c25;
809
+      if (input.substr(peg$currPos, 2) === peg$c36) {
810
+        s1 = peg$c36;
691 811
         peg$currPos += 2;
692 812
       } else {
693 813
         s1 = peg$FAILED;
694
-        if (peg$silentFails === 0) { peg$fail(peg$c26); }
814
+        if (peg$silentFails === 0) { peg$fail(peg$c37); }
695 815
       }
696 816
       if (s1 !== peg$FAILED) {
697 817
         s2 = peg$parsevalidFormatTag();
698 818
         if (s2 !== peg$FAILED) {
699 819
           if (input.charCodeAt(peg$currPos) === 62) {
700
-            s3 = peg$c17;
820
+            s3 = peg$c5;
701 821
             peg$currPos++;
702 822
           } else {
703 823
             s3 = peg$FAILED;
704
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
824
+            if (peg$silentFails === 0) { peg$fail(peg$c6); }
705 825
           }
706 826
           if (s3 !== peg$FAILED) {
707 827
             peg$savedPos = s0;
708
-            s1 = peg$c27(s2);
828
+            s1 = peg$c38(s2);
709 829
             s0 = s1;
710 830
           } else {
711 831
             peg$currPos = s0;
... ...
@@ -727,43 +847,43 @@ p2c2 = (function() {
727 847
       var s0;
728 848
 
729 849
       if (input.charCodeAt(peg$currPos) === 98) {
730
-        s0 = peg$c28;
850
+        s0 = peg$c39;
731 851
         peg$currPos++;
732 852
       } else {
733 853
         s0 = peg$FAILED;
734
-        if (peg$silentFails === 0) { peg$fail(peg$c29); }
854
+        if (peg$silentFails === 0) { peg$fail(peg$c40); }
735 855
       }
736 856
       if (s0 === peg$FAILED) {
737 857
         if (input.charCodeAt(peg$currPos) === 105) {
738
-          s0 = peg$c30;
858
+          s0 = peg$c41;
739 859
           peg$currPos++;
740 860
         } else {
741 861
           s0 = peg$FAILED;
742
-          if (peg$silentFails === 0) { peg$fail(peg$c31); }
862
+          if (peg$silentFails === 0) { peg$fail(peg$c42); }
743 863
         }
744 864
         if (s0 === peg$FAILED) {
745 865
           if (input.charCodeAt(peg$currPos) === 115) {
746
-            s0 = peg$c4;
866
+            s0 = peg$c19;
747 867
             peg$currPos++;
748 868
           } else {
749 869
             s0 = peg$FAILED;
750
-            if (peg$silentFails === 0) { peg$fail(peg$c5); }
870
+            if (peg$silentFails === 0) { peg$fail(peg$c20); }
751 871
           }
752 872
           if (s0 === peg$FAILED) {
753 873
             if (input.charCodeAt(peg$currPos) === 117) {
754
-              s0 = peg$c32;
874
+              s0 = peg$c43;
755 875
               peg$currPos++;
756 876
             } else {
757 877
               s0 = peg$FAILED;
758
-              if (peg$silentFails === 0) { peg$fail(peg$c33); }
878
+              if (peg$silentFails === 0) { peg$fail(peg$c44); }
759 879
             }
760 880
             if (s0 === peg$FAILED) {
761
-              if (input.substr(peg$currPos, 2) === peg$c34) {
762
-                s0 = peg$c34;
881
+              if (input.substr(peg$currPos, 2) === peg$c45) {
882
+                s0 = peg$c45;
763 883
                 peg$currPos += 2;
764 884
               } else {
765 885
                 s0 = peg$FAILED;
766
-                if (peg$silentFails === 0) { peg$fail(peg$c35); }
886
+                if (peg$silentFails === 0) { peg$fail(peg$c46); }
767 887
               }
768 888
             }
769 889
           }
... ...
@@ -778,25 +898,25 @@ p2c2 = (function() {
778 898
 
779 899
       s0 = peg$currPos;
780 900
       if (input.charCodeAt(peg$currPos) === 60) {
781
-        s1 = peg$c15;
901
+        s1 = peg$c2;
782 902
         peg$currPos++;
783 903
       } else {
784 904
         s1 = peg$FAILED;
785
-        if (peg$silentFails === 0) { peg$fail(peg$c16); }
905
+        if (peg$silentFails === 0) { peg$fail(peg$c3); }
786 906
       }
787 907
       if (s1 !== peg$FAILED) {
788 908
         s2 = peg$parseinvalidTag();
789 909
         if (s2 !== peg$FAILED) {
790 910
           if (input.charCodeAt(peg$currPos) === 62) {
791
-            s3 = peg$c17;
911
+            s3 = peg$c5;
792 912
             peg$currPos++;
793 913
           } else {
794 914
             s3 = peg$FAILED;
795
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
915
+            if (peg$silentFails === 0) { peg$fail(peg$c6); }
796 916
           }
797 917
           if (s3 !== peg$FAILED) {
798 918
             peg$savedPos = s0;
799
-            s1 = peg$c36();
919
+            s1 = peg$c47(s2);
800 920
             s0 = s1;
801 921
           } else {
802 922
             peg$currPos = s0;
... ...
@@ -818,26 +938,26 @@ p2c2 = (function() {
818 938
       var s0, s1, s2, s3;
819 939
 
820 940
       s0 = peg$currPos;
821
-      if (input.substr(peg$currPos, 2) === peg$c25) {
822
-        s1 = peg$c25;
941
+      if (input.substr(peg$currPos, 2) === peg$c36) {
942
+        s1 = peg$c36;
823 943
         peg$currPos += 2;
824 944
       } else {
825 945
         s1 = peg$FAILED;
826
-        if (peg$silentFails === 0) { peg$fail(peg$c26); }
946
+        if (peg$silentFails === 0) { peg$fail(peg$c37); }
827 947
       }
828 948
       if (s1 !== peg$FAILED) {
829 949
         s2 = peg$parseinvalidTag();
830 950
         if (s2 !== peg$FAILED) {
831 951
           if (input.charCodeAt(peg$currPos) === 62) {
832
-            s3 = peg$c17;
952
+            s3 = peg$c5;
833 953
             peg$currPos++;
834 954
           } else {
835 955
             s3 = peg$FAILED;
836
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
956
+            if (peg$silentFails === 0) { peg$fail(peg$c6); }
837 957
           }
838 958
           if (s3 !== peg$FAILED) {
839 959
             peg$savedPos = s0;
840
-            s1 = peg$c36();
960
+            s1 = peg$c48(s2);
841 961
             s0 = s1;
842 962
           } else {
843 963
             peg$currPos = s0;
... ...
@@ -859,30 +979,36 @@ p2c2 = (function() {
859 979
       var s0, s1, s2, s3;
860 980
 
861 981
       s0 = peg$currPos;
862
-      if (peg$c37.test(input.charAt(peg$currPos))) {
982
+      if (peg$c49.test(input.charAt(peg$currPos))) {
863 983
         s1 = input.charAt(peg$currPos);
864 984
         peg$currPos++;
865 985
       } else {
866 986
         s1 = peg$FAILED;
867
-        if (peg$silentFails === 0) { peg$fail(peg$c38); }
987
+        if (peg$silentFails === 0) { peg$fail(peg$c50); }
868 988
       }
869 989
       if (s1 !== peg$FAILED) {
870 990
         s2 = [];
871
-        if (peg$c39.test(input.charAt(peg$currPos))) {
872
-          s3 = input.charAt(peg$currPos);
873
-          peg$currPos++;
874
-        } else {
875
-          s3 = peg$FAILED;
876
-          if (peg$silentFails === 0) { peg$fail(peg$c40); }
877
-        }
878
-        while (s3 !== peg$FAILED) {
879
-          s2.push(s3);
880
-          if (peg$c39.test(input.charAt(peg$currPos))) {
991
+        s3 = peg$parsexmlSpecialChar();
992
+        if (s3 === peg$FAILED) {
993
+          if (peg$c51.test(input.charAt(peg$currPos))) {
881 994
             s3 = input.charAt(peg$currPos);
882 995
             peg$currPos++;
883 996
           } else {
884 997
             s3 = peg$FAILED;
885
-            if (peg$silentFails === 0) { peg$fail(peg$c40); }
998
+            if (peg$silentFails === 0) { peg$fail(peg$c52); }
999
+          }
1000
+        }
1001
+        while (s3 !== peg$FAILED) {
1002
+          s2.push(s3);
1003
+          s3 = peg$parsexmlSpecialChar();
1004
+          if (s3 === peg$FAILED) {
1005
+            if (peg$c51.test(input.charAt(peg$currPos))) {
1006
+              s3 = input.charAt(peg$currPos);
1007
+              peg$currPos++;
1008
+            } else {
1009
+              s3 = peg$FAILED;
1010
+              if (peg$silentFails === 0) { peg$fail(peg$c52); }
1011
+            }
886 1012
           }
887 1013
         }
888 1014
         if (s2 !== peg$FAILED) {
... ...
@@ -904,53 +1030,53 @@ p2c2 = (function() {
904 1030
       var s0, s1, s2, s3, s4, s5;
905 1031
 
906 1032
       s0 = peg$currPos;
907
-      if (input.substr(peg$currPos, 2) === peg$c41) {
908
-        s1 = peg$c41;
1033
+      if (input.substr(peg$currPos, 2) === peg$c53) {
1034
+        s1 = peg$c53;
909 1035
         peg$currPos += 2;
910 1036
       } else {
911 1037
         s1 = peg$FAILED;
912
-        if (peg$silentFails === 0) { peg$fail(peg$c42); }
1038
+        if (peg$silentFails === 0) { peg$fail(peg$c54); }
913 1039
       }
914 1040
       if (s1 !== peg$FAILED) {
915 1041
         s2 = peg$parsetagAttributes();
916 1042
         if (s2 !== peg$FAILED) {
917 1043
           if (input.charCodeAt(peg$currPos) === 62) {
918
-            s3 = peg$c17;
1044
+            s3 = peg$c5;
919 1045
             peg$currPos++;
920 1046
           } else {
921 1047
             s3 = peg$FAILED;
922
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
1048
+            if (peg$silentFails === 0) { peg$fail(peg$c6); }
923 1049
           }
924 1050
           if (s3 !== peg$FAILED) {
925 1051
             s4 = [];
926
-            if (peg$c43.test(input.charAt(peg$currPos))) {
1052
+            if (peg$c55.test(input.charAt(peg$currPos))) {
927 1053
               s5 = input.charAt(peg$currPos);
928 1054
               peg$currPos++;
929 1055
             } else {
930 1056
               s5 = peg$FAILED;
931
-              if (peg$silentFails === 0) { peg$fail(peg$c44); }
1057
+              if (peg$silentFails === 0) { peg$fail(peg$c56); }
932 1058
             }
933 1059
             while (s5 !== peg$FAILED) {
934 1060
               s4.push(s5);
935
-              if (peg$c43.test(input.charAt(peg$currPos))) {
1061
+              if (peg$c55.test(input.charAt(peg$currPos))) {
936 1062
                 s5 = input.charAt(peg$currPos);
937 1063
                 peg$currPos++;
938 1064
               } else {
939 1065
                 s5 = peg$FAILED;
940
-                if (peg$silentFails === 0) { peg$fail(peg$c44); }
1066
+                if (peg$silentFails === 0) { peg$fail(peg$c56); }
941 1067
               }
942 1068
             }
943 1069
             if (s4 !== peg$FAILED) {
944
-              if (input.substr(peg$currPos, 4) === peg$c45) {
945
-                s5 = peg$c45;
1070
+              if (input.substr(peg$currPos, 4) === peg$c57) {
1071
+                s5 = peg$c57;
946 1072
                 peg$currPos += 4;
947 1073
               } else {
948 1074
                 s5 = peg$FAILED;
949
-                if (peg$silentFails === 0) { peg$fail(peg$c46); }
1075
+                if (peg$silentFails === 0) { peg$fail(peg$c58); }
950 1076
               }
951 1077
               if (s5 !== peg$FAILED) {
952 1078
                 peg$savedPos = s0;
953
-                s1 = peg$c47(s2);
1079
+                s1 = peg$c59(s2);
954 1080
                 s0 = s1;
955 1081
               } else {
956 1082
                 peg$currPos = s0;
... ...
@@ -983,17 +1109,17 @@ p2c2 = (function() {
983 1109
       s1 = [];
984 1110
       s2 = peg$currPos;
985 1111
       if (input.charCodeAt(peg$currPos) === 32) {
986
-        s3 = peg$c48;
1112
+        s3 = peg$c60;
987 1113
         peg$currPos++;
988 1114
       } else {
989 1115
         s3 = peg$FAILED;
990
-        if (peg$silentFails === 0) { peg$fail(peg$c49); }
1116
+        if (peg$silentFails === 0) { peg$fail(peg$c61); }
991 1117
       }
992 1118
       if (s3 !== peg$FAILED) {
993 1119
         s4 = peg$parsetagAttribute();
994 1120
         if (s4 !== peg$FAILED) {
995 1121
           peg$savedPos = s2;
996
-          s3 = peg$c50(s3, s4);
1122
+          s3 = peg$c62(s3, s4);
997 1123
           s2 = s3;
998 1124
         } else {
999 1125
           peg$currPos = s2;
... ...
@@ -1007,17 +1133,17 @@ p2c2 = (function() {
1007 1133
         s1.push(s2);
1008 1134
         s2 = peg$currPos;
1009 1135
         if (input.charCodeAt(peg$currPos) === 32) {
1010
-          s3 = peg$c48;
1136
+          s3 = peg$c60;
1011 1137
           peg$currPos++;
1012 1138
         } else {
1013 1139
           s3 = peg$FAILED;
1014
-          if (peg$silentFails === 0) { peg$fail(peg$c49); }
1140
+          if (peg$silentFails === 0) { peg$fail(peg$c61); }
1015 1141
         }
1016 1142
         if (s3 !== peg$FAILED) {
1017 1143
           s4 = peg$parsetagAttribute();
1018 1144
           if (s4 !== peg$FAILED) {
1019 1145
             peg$savedPos = s2;
1020
-            s3 = peg$c50(s3, s4);
1146
+            s3 = peg$c62(s3, s4);
1021 1147
             s2 = s3;
1022 1148
           } else {
1023 1149
             peg$currPos = s2;
... ...
@@ -1030,7 +1156,7 @@ p2c2 = (function() {
1030 1156
       }
1031 1157
       if (s1 !== peg$FAILED) {
1032 1158
         peg$savedPos = s0;
1033
-        s1 = peg$c51(s1);
1159
+        s1 = peg$c63(s1);
1034 1160
       }
1035 1161
       s0 = s1;
1036 1162
 
... ...
@@ -1043,22 +1169,22 @@ p2c2 = (function() {
1043 1169
       s0 = peg$currPos;
1044 1170
       s1 = peg$currPos;
1045 1171
       s2 = [];
1046
-      if (peg$c52.test(input.charAt(peg$currPos))) {
1172
+      if (peg$c64.test(input.charAt(peg$currPos))) {
1047 1173
         s3 = input.charAt(peg$currPos);
1048 1174
         peg$currPos++;
1049 1175
       } else {
1050 1176
         s3 = peg$FAILED;
1051
-        if (peg$silentFails === 0) { peg$fail(peg$c53); }
1177
+        if (peg$silentFails === 0) { peg$fail(peg$c65); }
1052 1178
       }
1053 1179
       if (s3 !== peg$FAILED) {
1054 1180
         while (s3 !== peg$FAILED) {
1055 1181
           s2.push(s3);
1056
-          if (peg$c52.test(input.charAt(peg$currPos))) {
1182
+          if (peg$c64.test(input.charAt(peg$currPos))) {
1057 1183
             s3 = input.charAt(peg$currPos);
1058 1184
             peg$currPos++;
1059 1185
           } else {
1060 1186
             s3 = peg$FAILED;
1061
-            if (peg$silentFails === 0) { peg$fail(peg$c53); }
1187
+            if (peg$silentFails === 0) { peg$fail(peg$c65); }
1062 1188
           }
1063 1189
         }
1064 1190
       } else {
... ...
@@ -1071,31 +1197,31 @@ p2c2 = (function() {
1071 1197
       }
1072 1198
       if (s1 !== peg$FAILED) {
1073 1199
         s2 = peg$currPos;
1074
-        if (input.substr(peg$currPos, 2) === peg$c54) {
1075
-          s3 = peg$c54;
1200
+        if (input.substr(peg$currPos, 2) === peg$c66) {
1201
+          s3 = peg$c66;
1076 1202
           peg$currPos += 2;
1077 1203
         } else {
1078 1204
           s3 = peg$FAILED;
1079
-          if (peg$silentFails === 0) { peg$fail(peg$c55); }
1205
+          if (peg$silentFails === 0) { peg$fail(peg$c67); }
1080 1206
         }
1081 1207
         if (s3 !== peg$FAILED) {
1082 1208
           s4 = peg$currPos;
1083 1209
           s5 = [];
1084
-          if (peg$c56.test(input.charAt(peg$currPos))) {
1210
+          if (peg$c68.test(input.charAt(peg$currPos))) {
1085 1211
             s6 = input.charAt(peg$currPos);
1086 1212
             peg$currPos++;
1087 1213
           } else {
1088 1214
             s6 = peg$FAILED;
1089
-            if (peg$silentFails === 0) { peg$fail(peg$c57); }
1215
+            if (peg$silentFails === 0) { peg$fail(peg$c69); }
1090 1216
           }
1091 1217
           while (s6 !== peg$FAILED) {
1092 1218
             s5.push(s6);
1093
-            if (peg$c56.test(input.charAt(peg$currPos))) {
1219
+            if (peg$c68.test(input.charAt(peg$currPos))) {
1094 1220
               s6 = input.charAt(peg$currPos);
1095 1221
               peg$currPos++;
1096 1222
             } else {
1097 1223
               s6 = peg$FAILED;
1098
-              if (peg$silentFails === 0) { peg$fail(peg$c57); }
1224
+              if (peg$silentFails === 0) { peg$fail(peg$c69); }
1099 1225
             }
1100 1226
           }
1101 1227
           if (s5 !== peg$FAILED) {
... ...
@@ -1105,15 +1231,15 @@ p2c2 = (function() {
1105 1231
           }
1106 1232
           if (s4 !== peg$FAILED) {
1107 1233
             if (input.charCodeAt(peg$currPos) === 34) {
1108
-              s5 = peg$c58;
1234
+              s5 = peg$c11;
1109 1235
               peg$currPos++;
1110 1236
             } else {
1111 1237
               s5 = peg$FAILED;
1112
-              if (peg$silentFails === 0) { peg$fail(peg$c59); }
1238
+              if (peg$silentFails === 0) { peg$fail(peg$c12); }
1113 1239
             }
1114 1240
             if (s5 !== peg$FAILED) {
1115 1241
               peg$savedPos = s2;
1116
-              s3 = peg$c60(s1, s4);
1242
+              s3 = peg$c70(s1, s4);
1117 1243
               s2 = s3;
1118 1244
             } else {
1119 1245
               peg$currPos = s2;
... ...
@@ -1132,7 +1258,7 @@ p2c2 = (function() {
1132 1258
         }
1133 1259
         if (s2 !== peg$FAILED) {
1134 1260
           peg$savedPos = s0;
1135
-          s1 = peg$c61(s1, s2);
1261
+          s1 = peg$c71(s1, s2);
1136 1262
           s0 = s1;
1137 1263
         } else {
1138 1264
           peg$currPos = s0;
... ...
@@ -1173,7 +1299,7 @@ p2c2 = (function() {
1173 1299
       }
1174 1300
       if (s1 !== peg$FAILED) {
1175 1301
         peg$savedPos = s0;
1176
-        s1 = peg$c62(s1);
1302
+        s1 = peg$c72(s1);
1177 1303
       }
1178 1304
       s0 = s1;
1179 1305
 
... ...
@@ -1187,17 +1313,17 @@ p2c2 = (function() {
1187 1313
       s1 = peg$parsenorlogeYear();
1188 1314
       if (s1 !== peg$FAILED) {
1189 1315
         if (input.charCodeAt(peg$currPos) === 47) {
1190
-          s2 = peg$c63;
1316
+          s2 = peg$c73;
1191 1317
           peg$currPos++;
1192 1318
         } else {
1193 1319
           s2 = peg$FAILED;
1194
-          if (peg$silentFails === 0) { peg$fail(peg$c64); }
1320
+          if (peg$silentFails === 0) { peg$fail(peg$c74); }
1195 1321
         }
1196 1322
         if (s2 !== peg$FAILED) {
1197 1323
           s3 = peg$parselongNorloge();
1198 1324
           if (s3 !== peg$FAILED) {
1199 1325
             peg$savedPos = s0;
1200
-            s1 = peg$c65(s1, s3);
1326
+            s1 = peg$c75(s1, s3);
1201 1327
             s0 = s1;
1202 1328
           } else {
1203 1329
             peg$currPos = s0;
... ...
@@ -1220,22 +1346,22 @@ p2c2 = (function() {
1220 1346
 
1221 1347
       s0 = peg$currPos;
1222 1348
       s1 = [];
1223
-      if (peg$c66.test(input.charAt(peg$currPos))) {
1349
+      if (peg$c76.test(input.charAt(peg$currPos))) {
1224 1350
         s2 = input.charAt(peg$currPos);
1225 1351
         peg$currPos++;
1226 1352
       } else {
1227 1353
         s2 = peg$FAILED;
1228
-        if (peg$silentFails === 0) { peg$fail(peg$c67); }
1354
+        if (peg$silentFails === 0) { peg$fail(peg$c77); }
1229 1355
       }
1230 1356
       if (s2 !== peg$FAILED) {
1231 1357
         while (s2 !== peg$FAILED) {
1232 1358
           s1.push(s2);
1233
-          if (peg$c66.test(input.charAt(peg$currPos))) {
1359
+          if (peg$c76.test(input.charAt(peg$currPos))) {
1234 1360
             s2 = input.charAt(peg$currPos);
1235 1361
             peg$currPos++;
1236 1362
           } else {
1237 1363
             s2 = peg$FAILED;
1238
-            if (peg$silentFails === 0) { peg$fail(peg$c67); }
1364
+            if (peg$silentFails === 0) { peg$fail(peg$c77); }
1239 1365
           }
1240 1366
         }
1241 1367
       } else {
... ...
@@ -1243,7 +1369,7 @@ p2c2 = (function() {
1243 1369
       }
1244 1370
       if (s1 !== peg$FAILED) {
1245 1371
         peg$savedPos = s0;
1246
-        s1 = peg$c68(s1);
1372
+        s1 = peg$c78(s1);
1247 1373
       }
1248 1374
       s0 = s1;
1249 1375
 
... ...
@@ -1257,27 +1383,27 @@ p2c2 = (function() {
1257 1383
       s1 = peg$parsenorlogeMonth();
1258 1384
       if (s1 !== peg$FAILED) {
1259 1385
         if (input.charCodeAt(peg$currPos) === 47) {
1260
-          s2 = peg$c63;
1386
+          s2 = peg$c73;
1261 1387
           peg$currPos++;
1262 1388
         } else {
1263 1389
           s2 = peg$FAILED;
1264
-          if (peg$silentFails === 0) { peg$fail(peg$c64); }
1390
+          if (peg$silentFails === 0) { peg$fail(peg$c74); }
1265 1391
         }
1266 1392
         if (s2 !== peg$FAILED) {
1267 1393
           s3 = peg$parsenorlogeDay();
1268 1394
           if (s3 !== peg$FAILED) {
1269 1395
             if (input.charCodeAt(peg$currPos) === 35) {
1270
-              s4 = peg$c69;
1396
+              s4 = peg$c79;
1271 1397
               peg$currPos++;
1272 1398
             } else {
1273 1399
               s4 = peg$FAILED;
1274
-              if (peg$silentFails === 0) { peg$fail(peg$c70); }
1400
+              if (peg$silentFails === 0) { peg$fail(peg$c80); }
1275 1401
             }
1276 1402
             if (s4 !== peg$FAILED) {
1277 1403
               s5 = peg$parsenormalNorloge();
1278 1404
               if (s5 !== peg$FAILED) {
1279 1405
                 peg$savedPos = s0;
1280
-                s1 = peg$c71(s1, s3, s5);
1406
+                s1 = peg$c81(s1, s3, s5);
1281 1407
                 s0 = s1;
1282 1408
               } else {
1283 1409
                 peg$currPos = s0;
... ...
@@ -1307,24 +1433,24 @@ p2c2 = (function() {
1307 1433
       var s0, s1, s2;
1308 1434
 
1309 1435
       s0 = peg$currPos;
1310
-      if (peg$c72.test(input.charAt(peg$currPos))) {
1436
+      if (peg$c82.test(input.charAt(peg$currPos))) {
1311 1437
         s1 = input.charAt(peg$currPos);
1312 1438
         peg$currPos++;
1313 1439
       } else {
1314 1440
         s1 = peg$FAILED;
1315
-        if (peg$silentFails === 0) { peg$fail(peg$c73); }
1441
+        if (peg$silentFails === 0) { peg$fail(peg$c83); }
1316 1442
       }
1317 1443
       if (s1 !== peg$FAILED) {
1318
-        if (peg$c66.test(input.charAt(peg$currPos))) {
1444
+        if (peg$c76.test(input.charAt(peg$currPos))) {
1319 1445
           s2 = input.charAt(peg$currPos);
1320 1446
           peg$currPos++;
1321 1447
         } else {
1322 1448
           s2 = peg$FAILED;
1323
-          if (peg$silentFails === 0) { peg$fail(peg$c67); }
1449
+          if (peg$silentFails === 0) { peg$fail(peg$c77); }
1324 1450
         }
1325 1451
         if (s2 !== peg$FAILED) {
1326 1452
           peg$savedPos = s0;
1327
-          s1 = peg$c74(s1, s2);
1453
+          s1 = peg$c84(s1, s2);
1328 1454
           s0 = s1;
1329 1455
         } else {
1330 1456
           peg$currPos = s0;
... ...
@@ -1342,24 +1468,24 @@ p2c2 = (function() {
1342 1468
       var s0, s1, s2;
1343 1469
 
1344 1470
       s0 = peg$currPos;
1345
-      if (peg$c75.test(input.charAt(peg$currPos))) {
1471
+      if (peg$c85.test(input.charAt(peg$currPos))) {
1346 1472
         s1 = input.charAt(peg$currPos);
1347 1473
         peg$currPos++;
1348 1474
       } else {
1349 1475
         s1 = peg$FAILED;
1350
-        if (peg$silentFails === 0) { peg$fail(peg$c76); }
1476
+        if (peg$silentFails === 0) { peg$fail(peg$c86); }
1351 1477
       }
1352 1478
       if (s1 !== peg$FAILED) {
1353
-        if (peg$c66.test(input.charAt(peg$currPos))) {
1479
+        if (peg$c76.test(input.charAt(peg$currPos))) {
1354 1480
           s2 = input.charAt(peg$currPos);
1355 1481
           peg$currPos++;
1356 1482
         } else {
1357 1483
           s2 = peg$FAILED;
1358
-          if (peg$silentFails === 0) { peg$fail(peg$c67); }
1484
+          if (peg$silentFails === 0) { peg$fail(peg$c77); }
1359 1485
         }
1360 1486
         if (s2 !== peg$FAILED) {
1361 1487
           peg$savedPos = s0;
1362
-          s1 = peg$c74(s1, s2);
1488
+          s1 = peg$c84(s1, s2);
1363 1489
           s0 = s1;
1364 1490
         } else {
1365 1491
           peg$currPos = s0;
... ...
@@ -1380,17 +1506,17 @@ p2c2 = (function() {
1380 1506
       s1 = peg$parseshortNorloge();
1381 1507
       if (s1 !== peg$FAILED) {
1382 1508
         if (input.charCodeAt(peg$currPos) === 58) {
1383
-          s2 = peg$c77;
1509
+          s2 = peg$c87;
1384 1510
           peg$currPos++;
1385 1511
         } else {
1386 1512
           s2 = peg$FAILED;
1387
-          if (peg$silentFails === 0) { peg$fail(peg$c78); }
1513
+          if (peg$silentFails === 0) { peg$fail(peg$c88); }
1388 1514
         }
1389 1515
         if (s2 !== peg$FAILED) {
1390 1516
           s3 = peg$parsenorlogeSeconds();
1391 1517
           if (s3 !== peg$FAILED) {
1392 1518
             peg$savedPos = s0;
1393
-            s1 = peg$c79(s1, s3);
1519
+            s1 = peg$c89(s1, s3);
1394 1520
             s0 = s1;
1395 1521
           } else {
1396 1522
             peg$currPos = s0;
... ...
@@ -1415,17 +1541,17 @@ p2c2 = (function() {
1415 1541
       s1 = peg$parsenorlogeHours();
1416 1542
       if (s1 !== peg$FAILED) {
1417 1543
         if (input.charCodeAt(peg$currPos) === 58) {
1418
-          s2 = peg$c77;
1544
+          s2 = peg$c87;
1419 1545
           peg$currPos++;
1420 1546
         } else {
1421 1547
           s2 = peg$FAILED;
1422
-          if (peg$silentFails === 0) { peg$fail(peg$c78); }
1548
+          if (peg$silentFails === 0) { peg$fail(peg$c88); }
1423 1549
         }
1424 1550
         if (s2 !== peg$FAILED) {
1425 1551
           s3 = peg$parsenorlogeMinutes();
1426 1552
           if (s3 !== peg$FAILED) {
1427 1553
             peg$savedPos = s0;
1428
-            s1 = peg$c80(s1, s3);
1554
+            s1 = peg$c90(s1, s3);
1429 1555
             s0 = s1;
1430 1556
           } else {
1431 1557
             peg$currPos = s0;
... ...
@@ -1447,24 +1573,24 @@ p2c2 = (function() {
1447 1573
       var s0, s1, s2;
1448 1574
 
1449 1575
       s0 = peg$currPos;
1450
-      if (peg$c81.test(input.charAt(peg$currPos))) {
1576
+      if (peg$c91.test(input.charAt(peg$currPos))) {
1451 1577
         s1 = input.charAt(peg$currPos);
1452 1578
         peg$currPos++;
1453 1579
       } else {
1454 1580
         s1 = peg$FAILED;
1455
-        if (peg$silentFails === 0) { peg$fail(peg$c82); }
1581
+        if (peg$silentFails === 0) { peg$fail(peg$c92); }
1456 1582
       }
1457 1583
       if (s1 !== peg$FAILED) {
1458
-        if (peg$c75.test(input.charAt(peg$currPos))) {
1584
+        if (peg$c85.test(input.charAt(peg$currPos))) {
1459 1585
           s2 = input.charAt(peg$currPos);
1460 1586
           peg$currPos++;
1461 1587
         } else {
1462 1588
           s2 = peg$FAILED;
1463
-          if (peg$silentFails === 0) { peg$fail(peg$c76); }
1589
+          if (peg$silentFails === 0) { peg$fail(peg$c86); }
1464 1590
         }
1465 1591
         if (s2 !== peg$FAILED) {
1466 1592
           peg$savedPos = s0;
1467
-          s1 = peg$c74(s1, s2);
1593
+          s1 = peg$c84(s1, s2);
1468 1594
           s0 = s1;
1469 1595
         } else {
1470 1596
           peg$currPos = s0;
... ...
@@ -1482,24 +1608,24 @@ p2c2 = (function() {
1482 1608
       var s0, s1, s2;
1483 1609
 
1484 1610
       s0 = peg$currPos;
1485
-      if (peg$c83.test(input.charAt(peg$currPos))) {
1611
+      if (peg$c93.test(input.charAt(peg$currPos))) {
1486 1612
         s1 = input.charAt(peg$currPos);
1487 1613
         peg$currPos++;
1488 1614
       } else {
1489 1615
         s1 = peg$FAILED;
1490
-        if (peg$silentFails === 0) { peg$fail(peg$c84); }
1616
+        if (peg$silentFails === 0) { peg$fail(peg$c94); }
1491 1617
       }
1492 1618
       if (s1 !== peg$FAILED) {
1493
-        if (peg$c66.test(input.charAt(peg$currPos))) {
1619
+        if (peg$c76.test(input.charAt(peg$currPos))) {
1494 1620
           s2 = input.charAt(peg$currPos);
1495 1621
           peg$currPos++;
1496 1622
         } else {
1497 1623
           s2 = peg$FAILED;
1498
-          if (peg$silentFails === 0) { peg$fail(peg$c67); }
1624
+          if (peg$silentFails === 0) { peg$fail(peg$c77); }
1499 1625
         }
1500 1626
         if (s2 !== peg$FAILED) {
1501 1627
           peg$savedPos = s0;
1502
-          s1 = peg$c74(s1, s2);
1628
+          s1 = peg$c84(s1, s2);
1503 1629
           s0 = s1;
1504 1630
         } else {
1505 1631
           peg$currPos = s0;
... ...
@@ -1517,24 +1643,24 @@ p2c2 = (function() {
1517 1643
       var s0, s1, s2;
1518 1644
 
1519 1645
       s0 = peg$currPos;
1520
-      if (peg$c83.test(input.charAt(peg$currPos))) {
1646
+      if (peg$c93.test(input.charAt(peg$currPos))) {
1521 1647
         s1 = input.charAt(peg$currPos);
1522 1648
         peg$currPos++;
1523 1649
       } else {
1524 1650
         s1 = peg$FAILED;
1525
-        if (peg$silentFails === 0) { peg$fail(peg$c84); }
1651
+        if (peg$silentFails === 0) { peg$fail(peg$c94); }
1526 1652
       }
1527 1653
       if (s1 !== peg$FAILED) {
1528
-        if (peg$c66.test(input.charAt(peg$currPos))) {
1654
+        if (peg$c76.test(input.charAt(peg$currPos))) {
1529 1655
           s2 = input.charAt(peg$currPos);
1530 1656
           peg$currPos++;
1531 1657
         } else {
1532 1658
           s2 = peg$FAILED;
1533
-          if (peg$silentFails === 0) { peg$fail(peg$c67); }
1659
+          if (peg$silentFails === 0) { peg$fail(peg$c77); }
1534 1660
         }
1535 1661
         if (s2 !== peg$FAILED) {
1536 1662
           peg$savedPos = s0;
1537
-          s1 = peg$c74(s1, s2);
1663
+          s1 = peg$c84(s1, s2);
1538 1664
           s0 = s1;
1539 1665
         } else {
1540 1666
           peg$currPos = s0;
... ...
@@ -1553,30 +1679,30 @@ p2c2 = (function() {
1553 1679
 
1554 1680
       s0 = peg$currPos;
1555 1681
       if (input.charCodeAt(peg$currPos) === 35) {
1556
-        s1 = peg$c69;
1682
+        s1 = peg$c79;
1557 1683
         peg$currPos++;
1558 1684
       } else {
1559 1685
         s1 = peg$FAILED;
1560
-        if (peg$silentFails === 0) { peg$fail(peg$c70); }
1686
+        if (peg$silentFails === 0) { peg$fail(peg$c80); }
1561 1687
       }
1562 1688
       if (s1 !== peg$FAILED) {
1563 1689
         s2 = [];
1564
-        if (peg$c85.test(input.charAt(peg$currPos))) {
1690
+        if (peg$c95.test(input.charAt(peg$currPos))) {
1565 1691
           s3 = input.charAt(peg$currPos);
1566 1692
           peg$currPos++;
1567 1693
         } else {
1568 1694
           s3 = peg$FAILED;
1569