Browse code

handle urls

devnewton authored on 19/06/2016 23:03:04
Showing 3 changed files
... ...
@@ -11,7 +11,7 @@ function convert() {
11 11
 convertButton.addEventListener('click', convert);
12 12
 
13 13
 function init() {
14
-	inputArea.value = '>o_/ 22:23:56 #5766f86ae4b00e368dfab8a3 [:bondour] 2016/06/19#10:22:01 les <b>moules<</b> \_o<';
14
+	inputArea.value = '>o_/ 22:23:56 #5766f86ae4b00e368dfab8a3 [:bondour] 2016/06/19#10:22:01 les <b>moules<</b> \\_o< https://sauf.ca http://totoz.eu/ ftp://ftp.fr.debian.org/';
15 15
 	convert();
16 16
 }
17 17
 document.readyState === "interactive" || document.readyState === "complete" ? init() : document.addEventListener("DOMContentLoaded", init);
... ...
@@ -38,72 +38,88 @@ p2c2 = (function() {
38 38
 
39 39
         peg$c0 = function(items) { return items.join(""); },
40 40
         peg$c1 = { type: "any", description: "any character" },
41
-        peg$c2 = "<",
42
-        peg$c3 = { type: "literal", value: "<", description: "\"<\"" },
43
-        peg$c4 = ">",
44
-        peg$c5 = { type: "literal", value: ">", description: "\">\"" },
45
-        peg$c6 = "</",
46
-        peg$c7 = { type: "literal", value: "</", description: "\"</\"" },
47
-        peg$c8 = function() { return ""; },
48
-        peg$c9 = /^[A-Za-z]/,
49
-        peg$c10 = { type: "class", value: "[A-Za-z]", description: "[A-Za-z]" },
50
-        peg$c11 = /^[^>]/,
51
-        peg$c12 = { type: "class", value: "[^>]", description: "[^>]" },
52
-        peg$c13 = "a",
53
-        peg$c14 = { type: "literal", value: "a", description: "\"a\"" },
54
-        peg$c15 = "b",
55
-        peg$c16 = { type: "literal", value: "b", description: "\"b\"" },
56
-        peg$c17 = "i",
57
-        peg$c18 = { type: "literal", value: "i", description: "\"i\"" },
58
-        peg$c19 = "s",
59
-        peg$c20 = { type: "literal", value: "s", description: "\"s\"" },
60
-        peg$c21 = "u",
61
-        peg$c22 = { type: "literal", value: "u", description: "\"u\"" },
62
-        peg$c23 = "tt",
63
-        peg$c24 = { type: "literal", value: "tt", description: "\"tt\"" },
64
-        peg$c25 = function(norloge) { return '<norloge>' + norloge +'</norloge>'},
65
-        peg$c26 = "/",
66
-        peg$c27 = { type: "literal", value: "/", description: "\"/\"" },
67
-        peg$c28 = function(y, ln) { return y + "/" + ln; },
68
-        peg$c29 = /^[0-9]/,
69
-        peg$c30 = { type: "class", value: "[0-9]", description: "[0-9]" },
70
-        peg$c31 = function(digits) { return digits.join(""); },
71
-        peg$c32 = "#",
72
-        peg$c33 = { type: "literal", value: "#", description: "\"#\"" },
73
-        peg$c34 = function(m, d, nn) { return m + "/" + d + "#" + nn; },
74
-        peg$c35 = /^[0-1]/,
75
-        peg$c36 = { type: "class", value: "[0-1]", description: "[0-1]" },
76
-        peg$c37 = /^[0-2]/,
77
-        peg$c38 = { type: "class", value: "[0-2]", description: "[0-2]" },
78
-        peg$c39 = function(first, last) { return first + last; },
79
-        peg$c40 = /^[0-3]/,
80
-        peg$c41 = { type: "class", value: "[0-3]", description: "[0-3]" },
81
-        peg$c42 = ":",
82
-        peg$c43 = { type: "literal", value: ":", description: "\":\"" },
83
-        peg$c44 = function(sn, s) { return sn + ":" + s; },
84
-        peg$c45 = function(h, m) { return h + ":" + m; },
85
-        peg$c46 = /^[0-5]/,
86
-        peg$c47 = { type: "class", value: "[0-5]", description: "[0-5]" },
87
-        peg$c48 = /^[a-zA-Z0-9_]/,
88
-        peg$c49 = { type: "class", value: "[a-zA-Z0-9_]", description: "[a-zA-Z0-9_]" },
89
-        peg$c50 = function(chars) { var norlogeId = chars.join("");
90
-           return '<norloge-id' + norlogeId + '">#' + norlogeId + '</norloge-id>';
41
+        peg$c2 = "http",
42
+        peg$c3 = { type: "literal", value: "http", description: "\"http\"" },
43
+        peg$c4 = "s",
44
+        peg$c5 = { type: "literal", value: "s", description: "\"s\"" },
45
+        peg$c6 = "ftp",
46
+        peg$c7 = { type: "literal", value: "ftp", description: "\"ftp\"" },
47
+        peg$c8 = "://",
48
+        peg$c9 = { type: "literal", value: "://", description: "\"://\"" },
49
+        peg$c10 = /^[^ \t\r\n]/,
50
+        peg$c11 = { type: "class", value: "[^ \\t\\r\\n]", description: "[^ \\t\\r\\n]" },
51
+        peg$c12 = function(url) {return '<url>' + url + '</url>'},
52
+        peg$c13 = "\\_",
53
+        peg$c14 = { type: "literal", value: "\\_", description: "\"\\\\_\"" },
54
+        peg$c15 = "<",
55
+        peg$c16 = { type: "literal", value: "<", description: "\"<\"" },
56
+        peg$c17 = ">",
57
+        peg$c18 = { type: "literal", value: ">", description: "\">\"" },
58
+        peg$c19 = "_/",
59
+        peg$c20 = { type: "literal", value: "_/", description: "\"_/\"" },
60
+        peg$c21 = function() {return '<canard/>';},
61
+        peg$c22 = /^[o0\xF4\xB0\xF8\xF2\xF3@]/,
62
+        peg$c23 = { type: "class", value: "[o0\xF4\xB0\xF8\xF2\xF3@]", description: "[o0\xF4\xB0\xF8\xF2\xF3@]" },
63
+        peg$c24 = "</",
64
+        peg$c25 = { type: "literal", value: "</", description: "\"</\"" },
65
+        peg$c26 = function() { return ""; },
66
+        peg$c27 = /^[A-Za-z]/,
67
+        peg$c28 = { type: "class", value: "[A-Za-z]", description: "[A-Za-z]" },
68
+        peg$c29 = /^[^>]/,
69
+        peg$c30 = { type: "class", value: "[^>]", description: "[^>]" },
70
+        peg$c31 = "a",
71
+        peg$c32 = { type: "literal", value: "a", description: "\"a\"" },
72
+        peg$c33 = "b",
73
+        peg$c34 = { type: "literal", value: "b", description: "\"b\"" },
74
+        peg$c35 = "i",
75
+        peg$c36 = { type: "literal", value: "i", description: "\"i\"" },
76
+        peg$c37 = "u",
77
+        peg$c38 = { type: "literal", value: "u", description: "\"u\"" },
78
+        peg$c39 = "tt",
79
+        peg$c40 = { type: "literal", value: "tt", description: "\"tt\"" },
80
+        peg$c41 = function(norloge) { return '<norloge>' + norloge +'</norloge>'},
81
+        peg$c42 = "/",
82
+        peg$c43 = { type: "literal", value: "/", description: "\"/\"" },
83
+        peg$c44 = function(y, ln) { return y + "/" + ln; },
84
+        peg$c45 = /^[0-9]/,
85
+        peg$c46 = { type: "class", value: "[0-9]", description: "[0-9]" },
86
+        peg$c47 = function(digits) { return digits.join(""); },
87
+        peg$c48 = "#",
88
+        peg$c49 = { type: "literal", value: "#", description: "\"#\"" },
89
+        peg$c50 = function(m, d, nn) { return m + "/" + d + "#" + nn; },
90
+        peg$c51 = /^[0-1]/,
91
+        peg$c52 = { type: "class", value: "[0-1]", description: "[0-1]" },
92
+        peg$c53 = function(first, last) { return first + last; },
93
+        peg$c54 = /^[0-3]/,
94
+        peg$c55 = { type: "class", value: "[0-3]", description: "[0-3]" },
95
+        peg$c56 = ":",
96
+        peg$c57 = { type: "literal", value: ":", description: "\":\"" },
97
+        peg$c58 = function(sn, s) { return sn + ":" + s; },
98
+        peg$c59 = function(h, m) { return h + ":" + m; },
99
+        peg$c60 = /^[0-2]/,
100
+        peg$c61 = { type: "class", value: "[0-2]", description: "[0-2]" },
101
+        peg$c62 = /^[0-5]/,
102
+        peg$c63 = { type: "class", value: "[0-5]", description: "[0-5]" },
103
+        peg$c64 = /^[a-zA-Z0-9_]/,
104
+        peg$c65 = { type: "class", value: "[a-zA-Z0-9_]", description: "[a-zA-Z0-9_]" },
105
+        peg$c66 = function(chars) { var norlogeId = chars.join("");
106
+           return '<norloge-id>#' + norlogeId + '</norloge-id>';
91 107
            },
92
-        peg$c51 = /^[a-zA-Z0-9\-_]/,
93
-        peg$c52 = { type: "class", value: "[a-zA-Z0-9-_]", description: "[a-zA-Z0-9-_]" },
94
-        peg$c53 = /^[<[]/,
95
-        peg$c54 = { type: "class", value: "[<[]", description: "[<[]" },
96
-        peg$c55 = function(bigorno) { return [].concat('<bigorno>', bigorno,'</bigorno>').join("")},
97
-        peg$c56 = "[:",
98
-        peg$c57 = { type: "literal", value: "[:", description: "\"[:\"" },
99
-        peg$c58 = /^[^\]]/,
100
-        peg$c59 = { type: "class", value: "[^\\]]", description: "[^\\]]" },
101
-        peg$c60 = "]",
102
-        peg$c61 = { type: "literal", value: "]", description: "\"]\"" },
103
-        peg$c62 = function(first, totoz, third) { var totozId = totoz.join(""); 
108
+        peg$c67 = /^[a-zA-Z0-9\-_]/,
109
+        peg$c68 = { type: "class", value: "[a-zA-Z0-9-_]", description: "[a-zA-Z0-9-_]" },
110
+        peg$c69 = /^[<[]/,
111
+        peg$c70 = { type: "class", value: "[<[]", description: "[<[]" },
112
+        peg$c71 = function(bigorno) { return [].concat('<bigorno>', bigorno,'</bigorno>').join("")},
113
+        peg$c72 = "[:",
114
+        peg$c73 = { type: "literal", value: "[:", description: "\"[:\"" },
115
+        peg$c74 = /^[^\]]/,
116
+        peg$c75 = { type: "class", value: "[^\\]]", description: "[^\\]]" },
117
+        peg$c76 = "]",
118
+        peg$c77 = { type: "literal", value: "]", description: "\"]\"" },
119
+        peg$c78 = function(first, totoz, third) { var totozId = totoz.join(""); 
104 120
           return '<totoz>' + totozId + '</totoz>'; },
105
-        peg$c63 = /^[ \t\r\n]/,
106
-        peg$c64 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" },
121
+        peg$c79 = /^[ \t\r\n]/,
122
+        peg$c80 = { type: "class", value: "[ \\t\\r\\n]", description: "[ \\t\\r\\n]" },
107 123
 
108 124
         peg$currPos          = 0,
109 125
         peg$savedPos         = 0,
... ...
@@ -312,22 +328,28 @@ p2c2 = (function() {
312 328
     function peg$parsepostItem() {
313 329
       var s0;
314 330
 
315
-      s0 = peg$parsetotoz();
331
+      s0 = peg$parseurl();
316 332
       if (s0 === peg$FAILED) {
317
-        s0 = peg$parsebigorno();
333
+        s0 = peg$parsetotoz();
318 334
         if (s0 === peg$FAILED) {
319
-          s0 = peg$parsenorloge();
335
+          s0 = peg$parsecanard();
320 336
           if (s0 === peg$FAILED) {
321
-            s0 = peg$parseopentag();
337
+            s0 = peg$parsebigorno();
322 338
             if (s0 === peg$FAILED) {
323
-              s0 = peg$parseclosetag();
339
+              s0 = peg$parsenorloge();
324 340
               if (s0 === peg$FAILED) {
325
-                if (input.length > peg$currPos) {
326
-                  s0 = input.charAt(peg$currPos);
327
-                  peg$currPos++;
328
-                } else {
329
-                  s0 = peg$FAILED;
330
-                  if (peg$silentFails === 0) { peg$fail(peg$c1); }
341
+                s0 = peg$parseopentag();
342
+                if (s0 === peg$FAILED) {
343
+                  s0 = peg$parseclosetag();
344
+                  if (s0 === peg$FAILED) {
345
+                    if (input.length > peg$currPos) {
346
+                      s0 = input.charAt(peg$currPos);
347
+                      peg$currPos++;
348
+                    } else {
349
+                      s0 = peg$FAILED;
350
+                      if (peg$silentFails === 0) { peg$fail(peg$c1); }
351
+                    }
352
+                  }
331 353
                 }
332 354
               }
333 355
             }
... ...
@@ -338,27 +360,227 @@ p2c2 = (function() {
338 360
       return s0;
339 361
     }
340 362
 
363
+    function peg$parseurl() {
364
+      var s0, s1, s2, s3, s4, s5, s6;
365
+
366
+      s0 = peg$currPos;
367
+      s1 = peg$currPos;
368
+      s2 = peg$currPos;
369
+      s3 = peg$currPos;
370
+      if (input.substr(peg$currPos, 4) === peg$c2) {
371
+        s4 = peg$c2;
372
+        peg$currPos += 4;
373
+      } else {
374
+        s4 = peg$FAILED;
375
+        if (peg$silentFails === 0) { peg$fail(peg$c3); }
376
+      }
377
+      if (s4 !== peg$FAILED) {
378
+        if (input.charCodeAt(peg$currPos) === 115) {
379
+          s5 = peg$c4;
380
+          peg$currPos++;
381
+        } else {
382
+          s5 = peg$FAILED;
383
+          if (peg$silentFails === 0) { peg$fail(peg$c5); }
384
+        }
385
+        if (s5 === peg$FAILED) {
386
+          s5 = null;
387
+        }
388
+        if (s5 !== peg$FAILED) {
389
+          s4 = [s4, s5];
390
+          s3 = s4;
391
+        } else {
392
+          peg$currPos = s3;
393
+          s3 = peg$FAILED;
394
+        }
395
+      } else {
396
+        peg$currPos = s3;
397
+        s3 = peg$FAILED;
398
+      }
399
+      if (s3 === peg$FAILED) {
400
+        if (input.substr(peg$currPos, 3) === peg$c6) {
401
+          s3 = peg$c6;
402
+          peg$currPos += 3;
403
+        } else {
404
+          s3 = peg$FAILED;
405
+          if (peg$silentFails === 0) { peg$fail(peg$c7); }
406
+        }
407
+      }
408
+      if (s3 !== peg$FAILED) {
409
+        if (input.substr(peg$currPos, 3) === peg$c8) {
410
+          s4 = peg$c8;
411
+          peg$currPos += 3;
412
+        } else {
413
+          s4 = peg$FAILED;
414
+          if (peg$silentFails === 0) { peg$fail(peg$c9); }
415
+        }
416
+        if (s4 !== peg$FAILED) {
417
+          s5 = [];
418
+          if (peg$c10.test(input.charAt(peg$currPos))) {
419
+            s6 = input.charAt(peg$currPos);
420
+            peg$currPos++;
421
+          } else {
422
+            s6 = peg$FAILED;
423
+            if (peg$silentFails === 0) { peg$fail(peg$c11); }
424
+          }
425
+          if (s6 !== peg$FAILED) {
426
+            while (s6 !== peg$FAILED) {
427
+              s5.push(s6);
428
+              if (peg$c10.test(input.charAt(peg$currPos))) {
429
+                s6 = input.charAt(peg$currPos);
430
+                peg$currPos++;
431
+              } else {
432
+                s6 = peg$FAILED;
433
+                if (peg$silentFails === 0) { peg$fail(peg$c11); }
434
+              }
435
+            }
436
+          } else {
437
+            s5 = peg$FAILED;
438
+          }
439
+          if (s5 !== peg$FAILED) {
440
+            s3 = [s3, s4, s5];
441
+            s2 = s3;
442
+          } else {
443
+            peg$currPos = s2;
444
+            s2 = peg$FAILED;
445
+          }
446
+        } else {
447
+          peg$currPos = s2;
448
+          s2 = peg$FAILED;
449
+        }
450
+      } else {
451
+        peg$currPos = s2;
452
+        s2 = peg$FAILED;
453
+      }
454
+      if (s2 !== peg$FAILED) {
455
+        s1 = input.substring(s1, peg$currPos);
456
+      } else {
457
+        s1 = s2;
458
+      }
459
+      if (s1 !== peg$FAILED) {
460
+        peg$savedPos = s0;
461
+        s1 = peg$c12(s1);
462
+      }
463
+      s0 = s1;
464
+
465
+      return s0;
466
+    }
467
+
468
+    function peg$parsecanard() {
469
+      var s0, s1, s2, s3, s4;
470
+
471
+      s0 = peg$currPos;
472
+      s1 = peg$currPos;
473
+      if (input.substr(peg$currPos, 2) === peg$c13) {
474
+        s2 = peg$c13;
475
+        peg$currPos += 2;
476
+      } else {
477
+        s2 = peg$FAILED;
478
+        if (peg$silentFails === 0) { peg$fail(peg$c14); }
479
+      }
480
+      if (s2 !== peg$FAILED) {
481
+        s3 = peg$parseteteCanard();
482
+        if (s3 !== peg$FAILED) {
483
+          if (input.charCodeAt(peg$currPos) === 60) {
484
+            s4 = peg$c15;
485
+            peg$currPos++;
486
+          } else {
487
+            s4 = peg$FAILED;
488
+            if (peg$silentFails === 0) { peg$fail(peg$c16); }
489
+          }
490
+          if (s4 !== peg$FAILED) {
491
+            s2 = [s2, s3, s4];
492
+            s1 = s2;
493
+          } else {
494
+            peg$currPos = s1;
495
+            s1 = peg$FAILED;
496
+          }
497
+        } else {
498
+          peg$currPos = s1;
499
+          s1 = peg$FAILED;
500
+        }
501
+      } else {
502
+        peg$currPos = s1;
503
+        s1 = peg$FAILED;
504
+      }
505
+      if (s1 === peg$FAILED) {
506
+        s1 = peg$currPos;
507
+        if (input.charCodeAt(peg$currPos) === 62) {
508
+          s2 = peg$c17;
509
+          peg$currPos++;
510
+        } else {
511
+          s2 = peg$FAILED;
512
+          if (peg$silentFails === 0) { peg$fail(peg$c18); }
513
+        }
514
+        if (s2 !== peg$FAILED) {
515
+          s3 = peg$parseteteCanard();
516
+          if (s3 !== peg$FAILED) {
517
+            if (input.substr(peg$currPos, 2) === peg$c19) {
518
+              s4 = peg$c19;
519
+              peg$currPos += 2;
520
+            } else {
521
+              s4 = peg$FAILED;
522
+              if (peg$silentFails === 0) { peg$fail(peg$c20); }
523
+            }
524
+            if (s4 !== peg$FAILED) {
525
+              s2 = [s2, s3, s4];
526
+              s1 = s2;
527
+            } else {
528
+              peg$currPos = s1;
529
+              s1 = peg$FAILED;
530
+            }
531
+          } else {
532
+            peg$currPos = s1;
533
+            s1 = peg$FAILED;
534
+          }
535
+        } else {
536
+          peg$currPos = s1;
537
+          s1 = peg$FAILED;
538
+        }
539
+      }
540
+      if (s1 !== peg$FAILED) {
541
+        peg$savedPos = s0;
542
+        s1 = peg$c21();
543
+      }
544
+      s0 = s1;
545
+
546
+      return s0;
547
+    }
548
+
549
+    function peg$parseteteCanard() {
550
+      var s0;
551
+
552
+      if (peg$c22.test(input.charAt(peg$currPos))) {
553
+        s0 = input.charAt(peg$currPos);
554
+        peg$currPos++;
555
+      } else {
556
+        s0 = peg$FAILED;
557
+        if (peg$silentFails === 0) { peg$fail(peg$c23); }
558
+      }
559
+
560
+      return s0;
561
+    }
562
+
341 563
     function peg$parseopentag() {
342 564
       var s0, s1, s2, s3, s4;
343 565
 
344 566
       s0 = peg$currPos;
345 567
       s1 = peg$currPos;
346 568
       if (input.charCodeAt(peg$currPos) === 60) {
347
-        s2 = peg$c2;
569
+        s2 = peg$c15;
348 570
         peg$currPos++;
349 571
       } else {
350 572
         s2 = peg$FAILED;
351
-        if (peg$silentFails === 0) { peg$fail(peg$c3); }
573
+        if (peg$silentFails === 0) { peg$fail(peg$c16); }
352 574
       }
353 575
       if (s2 !== peg$FAILED) {
354 576
         s3 = peg$parsetag();
355 577
         if (s3 !== peg$FAILED) {
356 578
           if (input.charCodeAt(peg$currPos) === 62) {
357
-            s4 = peg$c4;
579
+            s4 = peg$c17;
358 580
             peg$currPos++;
359 581
           } else {
360 582
             s4 = peg$FAILED;
361
-            if (peg$silentFails === 0) { peg$fail(peg$c5); }
583
+            if (peg$silentFails === 0) { peg$fail(peg$c18); }
362 584
           }
363 585
           if (s4 !== peg$FAILED) {
364 586
             s2 = [s2, s3, s4];
... ...
@@ -392,22 +614,22 @@ p2c2 = (function() {
392 614
 
393 615
       s0 = peg$currPos;
394 616
       s1 = peg$currPos;
395
-      if (input.substr(peg$currPos, 2) === peg$c6) {
396
-        s2 = peg$c6;
617
+      if (input.substr(peg$currPos, 2) === peg$c24) {
618
+        s2 = peg$c24;
397 619
         peg$currPos += 2;
398 620
       } else {
399 621
         s2 = peg$FAILED;
400
-        if (peg$silentFails === 0) { peg$fail(peg$c7); }
622
+        if (peg$silentFails === 0) { peg$fail(peg$c25); }
401 623
       }
402 624
       if (s2 !== peg$FAILED) {
403 625
         s3 = peg$parsetag();
404 626
         if (s3 !== peg$FAILED) {
405 627
           if (input.charCodeAt(peg$currPos) === 62) {
406
-            s4 = peg$c4;
628
+            s4 = peg$c17;
407 629
             peg$currPos++;
408 630
           } else {
409 631
             s4 = peg$FAILED;
410
-            if (peg$silentFails === 0) { peg$fail(peg$c5); }
632
+            if (peg$silentFails === 0) { peg$fail(peg$c18); }
411 633
           }
412 634
           if (s4 !== peg$FAILED) {
413 635
             s2 = [s2, s3, s4];
... ...
@@ -441,25 +663,25 @@ p2c2 = (function() {
441 663
 
442 664
       s0 = peg$currPos;
443 665
       if (input.charCodeAt(peg$currPos) === 60) {
444
-        s1 = peg$c2;
666
+        s1 = peg$c15;
445 667
         peg$currPos++;
446 668
       } else {
447 669
         s1 = peg$FAILED;
448
-        if (peg$silentFails === 0) { peg$fail(peg$c3); }
670
+        if (peg$silentFails === 0) { peg$fail(peg$c16); }
449 671
       }
450 672
       if (s1 !== peg$FAILED) {
451 673
         s2 = peg$parsetagName();
452 674
         if (s2 !== peg$FAILED) {
453 675
           if (input.charCodeAt(peg$currPos) === 62) {
454
-            s3 = peg$c4;
676
+            s3 = peg$c17;
455 677
             peg$currPos++;
456 678
           } else {
457 679
             s3 = peg$FAILED;
458
-            if (peg$silentFails === 0) { peg$fail(peg$c5); }
680
+            if (peg$silentFails === 0) { peg$fail(peg$c18); }
459 681
           }
460 682
           if (s3 !== peg$FAILED) {
461 683
             peg$savedPos = s0;
462
-            s1 = peg$c8();
684
+            s1 = peg$c26();
463 685
             s0 = s1;
464 686
           } else {
465 687
             peg$currPos = s0;
... ...
@@ -481,26 +703,26 @@ p2c2 = (function() {
481 703
       var s0, s1, s2, s3;
482 704
 
483 705
       s0 = peg$currPos;
484
-      if (input.substr(peg$currPos, 2) === peg$c6) {
485
-        s1 = peg$c6;
706
+      if (input.substr(peg$currPos, 2) === peg$c24) {
707
+        s1 = peg$c24;
486 708
         peg$currPos += 2;
487 709
       } else {
488 710
         s1 = peg$FAILED;
489
-        if (peg$silentFails === 0) { peg$fail(peg$c7); }
711
+        if (peg$silentFails === 0) { peg$fail(peg$c25); }
490 712
       }
491 713
       if (s1 !== peg$FAILED) {
492 714
         s2 = peg$parsetagName();
493 715
         if (s2 !== peg$FAILED) {
494 716
           if (input.charCodeAt(peg$currPos) === 62) {
495
-            s3 = peg$c4;
717
+            s3 = peg$c17;
496 718
             peg$currPos++;
497 719
           } else {
498 720
             s3 = peg$FAILED;
499
-            if (peg$silentFails === 0) { peg$fail(peg$c5); }
721
+            if (peg$silentFails === 0) { peg$fail(peg$c18); }
500 722
           }
501 723
           if (s3 !== peg$FAILED) {
502 724
             peg$savedPos = s0;
503
-            s1 = peg$c8();
725
+            s1 = peg$c26();
504 726
             s0 = s1;
505 727
           } else {
506 728
             peg$currPos = s0;
... ...
@@ -522,30 +744,30 @@ p2c2 = (function() {
522 744
       var s0, s1, s2, s3;
523 745
 
524 746
       s0 = peg$currPos;
525
-      if (peg$c9.test(input.charAt(peg$currPos))) {
747
+      if (peg$c27.test(input.charAt(peg$currPos))) {
526 748
         s1 = input.charAt(peg$currPos);
527 749
         peg$currPos++;
528 750
       } else {
529 751
         s1 = peg$FAILED;
530
-        if (peg$silentFails === 0) { peg$fail(peg$c10); }
752
+        if (peg$silentFails === 0) { peg$fail(peg$c28); }
531 753
       }
532 754
       if (s1 !== peg$FAILED) {
533 755
         s2 = [];
534
-        if (peg$c11.test(input.charAt(peg$currPos))) {
756
+        if (peg$c29.test(input.charAt(peg$currPos))) {
535 757
           s3 = input.charAt(peg$currPos);
536 758
           peg$currPos++;
537 759
         } else {
538 760
           s3 = peg$FAILED;
539
-          if (peg$silentFails === 0) { peg$fail(peg$c12); }
761
+          if (peg$silentFails === 0) { peg$fail(peg$c30); }
540 762
         }
541 763
         while (s3 !== peg$FAILED) {
542 764
           s2.push(s3);
543
-          if (peg$c11.test(input.charAt(peg$currPos))) {
765
+          if (peg$c29.test(input.charAt(peg$currPos))) {
544 766
             s3 = input.charAt(peg$currPos);
545 767
             peg$currPos++;
546 768
           } else {
547 769
             s3 = peg$FAILED;
548
-            if (peg$silentFails === 0) { peg$fail(peg$c12); }
770
+            if (peg$silentFails === 0) { peg$fail(peg$c30); }
549 771
           }
550 772
         }
551 773
         if (s2 !== peg$FAILED) {
... ...
@@ -567,51 +789,51 @@ p2c2 = (function() {
567 789
       var s0;
568 790
 
569 791
       if (input.charCodeAt(peg$currPos) === 97) {
570
-        s0 = peg$c13;
792
+        s0 = peg$c31;
571 793
         peg$currPos++;
572 794
       } else {
573 795
         s0 = peg$FAILED;
574
-        if (peg$silentFails === 0) { peg$fail(peg$c14); }
796
+        if (peg$silentFails === 0) { peg$fail(peg$c32); }
575 797
       }
576 798
       if (s0 === peg$FAILED) {
577 799
         if (input.charCodeAt(peg$currPos) === 98) {
578
-          s0 = peg$c15;
800
+          s0 = peg$c33;
579 801
           peg$currPos++;
580 802
         } else {
581 803
           s0 = peg$FAILED;
582
-          if (peg$silentFails === 0) { peg$fail(peg$c16); }
804
+          if (peg$silentFails === 0) { peg$fail(peg$c34); }
583 805
         }
584 806
         if (s0 === peg$FAILED) {
585 807
           if (input.charCodeAt(peg$currPos) === 105) {
586
-            s0 = peg$c17;
808
+            s0 = peg$c35;
587 809
             peg$currPos++;
588 810
           } else {
589 811
             s0 = peg$FAILED;
590
-            if (peg$silentFails === 0) { peg$fail(peg$c18); }
812
+            if (peg$silentFails === 0) { peg$fail(peg$c36); }
591 813
           }
592 814
           if (s0 === peg$FAILED) {
593 815
             if (input.charCodeAt(peg$currPos) === 115) {
594
-              s0 = peg$c19;
816
+              s0 = peg$c4;
595 817
               peg$currPos++;
596 818
             } else {
597 819
               s0 = peg$FAILED;
598
-              if (peg$silentFails === 0) { peg$fail(peg$c20); }
820
+              if (peg$silentFails === 0) { peg$fail(peg$c5); }
599 821
             }
600 822
             if (s0 === peg$FAILED) {
601 823
               if (input.charCodeAt(peg$currPos) === 117) {
602
-                s0 = peg$c21;
824
+                s0 = peg$c37;
603 825
                 peg$currPos++;
604 826
               } else {
605 827
                 s0 = peg$FAILED;
606
-                if (peg$silentFails === 0) { peg$fail(peg$c22); }
828
+                if (peg$silentFails === 0) { peg$fail(peg$c38); }
607 829
               }
608 830
               if (s0 === peg$FAILED) {
609
-                if (input.substr(peg$currPos, 2) === peg$c23) {
610
-                  s0 = peg$c23;
831
+                if (input.substr(peg$currPos, 2) === peg$c39) {
832
+                  s0 = peg$c39;
611 833
                   peg$currPos += 2;
612 834
                 } else {
613 835
                   s0 = peg$FAILED;
614
-                  if (peg$silentFails === 0) { peg$fail(peg$c24); }
836
+                  if (peg$silentFails === 0) { peg$fail(peg$c40); }
615 837
                 }
616 838
               }
617 839
             }
... ...
@@ -649,7 +871,7 @@ p2c2 = (function() {
649 871
       }
650 872
       if (s1 !== peg$FAILED) {
651 873
         peg$savedPos = s0;
652
-        s1 = peg$c25(s1);
874
+        s1 = peg$c41(s1);
653 875
       }
654 876
       s0 = s1;
655 877
 
... ...
@@ -663,17 +885,17 @@ p2c2 = (function() {
663 885
       s1 = peg$parsenorlogeYear();
664 886
       if (s1 !== peg$FAILED) {
665 887
         if (input.charCodeAt(peg$currPos) === 47) {
666
-          s2 = peg$c26;
888
+          s2 = peg$c42;
667 889
           peg$currPos++;
668 890
         } else {
669 891
           s2 = peg$FAILED;
670
-          if (peg$silentFails === 0) { peg$fail(peg$c27); }
892
+          if (peg$silentFails === 0) { peg$fail(peg$c43); }
671 893
         }
672 894
         if (s2 !== peg$FAILED) {
673 895
           s3 = peg$parselongNorloge();
674 896
           if (s3 !== peg$FAILED) {
675 897
             peg$savedPos = s0;
676
-            s1 = peg$c28(s1, s3);
898
+            s1 = peg$c44(s1, s3);
677 899
             s0 = s1;
678 900
           } else {
679 901
             peg$currPos = s0;
... ...
@@ -696,22 +918,22 @@ p2c2 = (function() {
696 918
 
697 919
       s0 = peg$currPos;
698 920
       s1 = [];
699
-      if (peg$c29.test(input.charAt(peg$currPos))) {
921
+      if (peg$c45.test(input.charAt(peg$currPos))) {
700 922
         s2 = input.charAt(peg$currPos);
701 923
         peg$currPos++;
702 924
       } else {
703 925
         s2 = peg$FAILED;
704
-        if (peg$silentFails === 0) { peg$fail(peg$c30); }
926
+        if (peg$silentFails === 0) { peg$fail(peg$c46); }
705 927
       }
706 928
       if (s2 !== peg$FAILED) {
707 929
         while (s2 !== peg$FAILED) {
708 930
           s1.push(s2);
709
-          if (peg$c29.test(input.charAt(peg$currPos))) {
931
+          if (peg$c45.test(input.charAt(peg$currPos))) {
710 932
             s2 = input.charAt(peg$currPos);
711 933
             peg$currPos++;
712 934
           } else {
713 935
             s2 = peg$FAILED;
714
-            if (peg$silentFails === 0) { peg$fail(peg$c30); }
936
+            if (peg$silentFails === 0) { peg$fail(peg$c46); }
715 937
           }
716 938
         }
717 939
       } else {
... ...
@@ -719,7 +941,7 @@ p2c2 = (function() {
719 941
       }
720 942
       if (s1 !== peg$FAILED) {
721 943
         peg$savedPos = s0;
722
-        s1 = peg$c31(s1);
944
+        s1 = peg$c47(s1);
723 945
       }
724 946
       s0 = s1;
725 947
 
... ...
@@ -733,27 +955,27 @@ p2c2 = (function() {
733 955
       s1 = peg$parsenorlogeMonth();
734 956
       if (s1 !== peg$FAILED) {
735 957
         if (input.charCodeAt(peg$currPos) === 47) {
736
-          s2 = peg$c26;
958
+          s2 = peg$c42;
737 959
           peg$currPos++;
738 960
         } else {
739 961
           s2 = peg$FAILED;
740
-          if (peg$silentFails === 0) { peg$fail(peg$c27); }
962
+          if (peg$silentFails === 0) { peg$fail(peg$c43); }
741 963
         }
742 964
         if (s2 !== peg$FAILED) {
743 965
           s3 = peg$parsenorlogeDay();
744 966
           if (s3 !== peg$FAILED) {
745 967
             if (input.charCodeAt(peg$currPos) === 35) {
746
-              s4 = peg$c32;
968
+              s4 = peg$c48;
747 969
               peg$currPos++;
748 970
             } else {
749 971
               s4 = peg$FAILED;
750
-              if (peg$silentFails === 0) { peg$fail(peg$c33); }
972
+              if (peg$silentFails === 0) { peg$fail(peg$c49); }
751 973
             }
752 974
             if (s4 !== peg$FAILED) {
753 975
               s5 = peg$parsenormalNorloge();
754 976
               if (s5 !== peg$FAILED) {
755 977
                 peg$savedPos = s0;
756
-                s1 = peg$c34(s1, s3, s5);
978
+                s1 = peg$c50(s1, s3, s5);
757 979
                 s0 = s1;
758 980
               } else {
759 981
                 peg$currPos = s0;
... ...
@@ -783,24 +1005,24 @@ p2c2 = (function() {
783 1005
       var s0, s1, s2;
784 1006
 
785 1007
       s0 = peg$currPos;
786
-      if (peg$c35.test(input.charAt(peg$currPos))) {
1008
+      if (peg$c51.test(input.charAt(peg$currPos))) {
787 1009
         s1 = input.charAt(peg$currPos);
788 1010
         peg$currPos++;
789 1011
       } else {
790 1012
         s1 = peg$FAILED;
791
-        if (peg$silentFails === 0) { peg$fail(peg$c36); }
1013
+        if (peg$silentFails === 0) { peg$fail(peg$c52); }
792 1014
       }
793 1015
       if (s1 !== peg$FAILED) {
794
-        if (peg$c37.test(input.charAt(peg$currPos))) {
1016
+        if (peg$c45.test(input.charAt(peg$currPos))) {
795 1017
           s2 = input.charAt(peg$currPos);
796 1018
           peg$currPos++;
797 1019
         } else {
798 1020
           s2 = peg$FAILED;
799
-          if (peg$silentFails === 0) { peg$fail(peg$c38); }
1021
+          if (peg$silentFails === 0) { peg$fail(peg$c46); }
800 1022
         }
801 1023
         if (s2 !== peg$FAILED) {
802 1024
           peg$savedPos = s0;
803
-          s1 = peg$c39(s1, s2);
1025
+          s1 = peg$c53(s1, s2);
804 1026
           s0 = s1;
805 1027
         } else {
806 1028
           peg$currPos = s0;
... ...
@@ -818,24 +1040,24 @@ p2c2 = (function() {
818 1040
       var s0, s1, s2;
819 1041
 
820 1042
       s0 = peg$currPos;
821
-      if (peg$c40.test(input.charAt(peg$currPos))) {
1043
+      if (peg$c54.test(input.charAt(peg$currPos))) {
822 1044
         s1 = input.charAt(peg$currPos);
823 1045
         peg$currPos++;
824 1046
       } else {
825 1047
         s1 = peg$FAILED;
826
-        if (peg$silentFails === 0) { peg$fail(peg$c41); }
1048
+        if (peg$silentFails === 0) { peg$fail(peg$c55); }
827 1049
       }
828 1050
       if (s1 !== peg$FAILED) {
829
-        if (peg$c29.test(input.charAt(peg$currPos))) {
1051
+        if (peg$c45.test(input.charAt(peg$currPos))) {
830 1052
           s2 = input.charAt(peg$currPos);
831 1053
           peg$currPos++;
832 1054
         } else {
833 1055
           s2 = peg$FAILED;
834
-          if (peg$silentFails === 0) { peg$fail(peg$c30); }
1056
+          if (peg$silentFails === 0) { peg$fail(peg$c46); }
835 1057
         }
836 1058
         if (s2 !== peg$FAILED) {
837 1059
           peg$savedPos = s0;
838
-          s1 = peg$c39(s1, s2);
1060
+          s1 = peg$c53(s1, s2);
839 1061
           s0 = s1;
840 1062
         } else {
841 1063
           peg$currPos = s0;
... ...
@@ -856,17 +1078,17 @@ p2c2 = (function() {
856 1078
       s1 = peg$parseshortNorloge();
857 1079
       if (s1 !== peg$FAILED) {
858 1080
         if (input.charCodeAt(peg$currPos) === 58) {
859
-          s2 = peg$c42;
1081
+          s2 = peg$c56;
860 1082
           peg$currPos++;
861 1083
         } else {
862 1084
           s2 = peg$FAILED;
863
-          if (peg$silentFails === 0) { peg$fail(peg$c43); }
1085
+          if (peg$silentFails === 0) { peg$fail(peg$c57); }
864 1086
         }
865 1087
         if (s2 !== peg$FAILED) {
866 1088
           s3 = peg$parsenorlogeSeconds();
867 1089
           if (s3 !== peg$FAILED) {
868 1090
             peg$savedPos = s0;
869
-            s1 = peg$c44(s1, s3);
1091
+            s1 = peg$c58(s1, s3);
870 1092
             s0 = s1;
871 1093
           } else {
872 1094
             peg$currPos = s0;
... ...
@@ -891,17 +1113,17 @@ p2c2 = (function() {
891 1113
       s1 = peg$parsenorlogeHours();
892 1114
       if (s1 !== peg$FAILED) {
893 1115
         if (input.charCodeAt(peg$currPos) === 58) {
894
-          s2 = peg$c42;
1116
+          s2 = peg$c56;
895 1117
           peg$currPos++;
896 1118
         } else {
897 1119
           s2 = peg$FAILED;
898
-          if (peg$silentFails === 0) { peg$fail(peg$c43); }
1120
+          if (peg$silentFails === 0) { peg$fail(peg$c57); }
899 1121
         }
900 1122
         if (s2 !== peg$FAILED) {
901 1123
           s3 = peg$parsenorlogeMinutes();
902 1124
           if (s3 !== peg$FAILED) {
903 1125
             peg$savedPos = s0;
904
-            s1 = peg$c45(s1, s3);
1126
+            s1 = peg$c59(s1, s3);
905 1127
             s0 = s1;
906 1128
           } else {
907 1129
             peg$currPos = s0;
... ...
@@ -923,24 +1145,24 @@ p2c2 = (function() {
923 1145
       var s0, s1, s2;
924 1146
 
925 1147
       s0 = peg$currPos;
926
-      if (peg$c37.test(input.charAt(peg$currPos))) {
1148
+      if (peg$c60.test(input.charAt(peg$currPos))) {
927 1149
         s1 = input.charAt(peg$currPos);
928 1150
         peg$currPos++;
929 1151
       } else {
930 1152
         s1 = peg$FAILED;
931
-        if (peg$silentFails === 0) { peg$fail(peg$c38); }
1153
+        if (peg$silentFails === 0) { peg$fail(peg$c61); }
932 1154
       }
933 1155
       if (s1 !== peg$FAILED) {
934
-        if (peg$c40.test(input.charAt(peg$currPos))) {
1156
+        if (peg$c54.test(input.charAt(peg$currPos))) {
935 1157
           s2 = input.charAt(peg$currPos);
936 1158
           peg$currPos++;
937 1159
         } else {
938 1160
           s2 = peg$FAILED;
939
-          if (peg$silentFails === 0) { peg$fail(peg$c41); }
1161
+          if (peg$silentFails === 0) { peg$fail(peg$c55); }
940 1162
         }
941 1163
         if (s2 !== peg$FAILED) {
942 1164
           peg$savedPos = s0;
943
-          s1 = peg$c39(s1, s2);
1165
+          s1 = peg$c53(s1, s2);
944 1166
           s0 = s1;
945 1167
         } else {
946 1168
           peg$currPos = s0;
... ...
@@ -958,24 +1180,24 @@ p2c2 = (function() {
958 1180
       var s0, s1, s2;
959 1181
 
960 1182
       s0 = peg$currPos;
961
-      if (peg$c46.test(input.charAt(peg$currPos))) {
1183
+      if (peg$c62.test(input.charAt(peg$currPos))) {
962 1184
         s1 = input.charAt(peg$currPos);
963 1185
         peg$currPos++;
964 1186
       } else {
965 1187
         s1 = peg$FAILED;
966
-        if (peg$silentFails === 0) { peg$fail(peg$c47); }
1188
+        if (peg$silentFails === 0) { peg$fail(peg$c63); }
967 1189
       }
968 1190
       if (s1 !== peg$FAILED) {
969
-        if (peg$c29.test(input.charAt(peg$currPos))) {
1191
+        if (peg$c45.test(input.charAt(peg$currPos))) {
970 1192
           s2 = input.charAt(peg$currPos);
971 1193
           peg$currPos++;
972 1194
         } else {
973 1195
           s2 = peg$FAILED;
974
-          if (peg$silentFails === 0) { peg$fail(peg$c30); }
1196
+          if (peg$silentFails === 0) { peg$fail(peg$c46); }
975 1197
         }
976 1198
         if (s2 !== peg$FAILED) {
977 1199
           peg$savedPos = s0;
978
-          s1 = peg$c39(s1, s2);
1200
+          s1 = peg$c53(s1, s2);
979 1201
           s0 = s1;
980 1202
         } else {
981 1203
           peg$currPos = s0;
... ...
@@ -993,24 +1215,24 @@ p2c2 = (function() {
993 1215
       var s0, s1, s2;
994 1216
 
995 1217
       s0 = peg$currPos;
996
-      if (peg$c46.test(input.charAt(peg$currPos))) {
1218
+      if (peg$c62.test(input.charAt(peg$currPos))) {
997 1219
         s1 = input.charAt(peg$currPos);
998 1220
         peg$currPos++;
999 1221
       } else {
1000 1222
         s1 = peg$FAILED;
1001
-        if (peg$silentFails === 0) { peg$fail(peg$c47); }
1223
+        if (peg$silentFails === 0) { peg$fail(peg$c63); }
1002 1224
       }
1003 1225
       if (s1 !== peg$FAILED) {
1004
-        if (peg$c29.test(input.charAt(peg$currPos))) {
1226
+        if (peg$c45.test(input.charAt(peg$currPos))) {
1005 1227
           s2 = input.charAt(peg$currPos);
1006 1228
           peg$currPos++;
1007 1229
         } else {
1008 1230
           s2 = peg$FAILED;
1009
-          if (peg$silentFails === 0) { peg$fail(peg$c30); }
1231
+          if (peg$silentFails === 0) { peg$fail(peg$c46); }
1010 1232
         }
1011 1233
         if (s2 !== peg$FAILED) {
1012 1234
           peg$savedPos = s0;
1013
-          s1 = peg$c39(s1, s2);
1235
+          s1 = peg$c53(s1, s2);
1014 1236
           s0 = s1;
1015 1237
         } else {
1016 1238
           peg$currPos = s0;
... ...
@@ -1029,30 +1251,30 @@ p2c2 = (function() {
1029 1251
 
1030 1252
       s0 = peg$currPos;
1031 1253
       if (input.charCodeAt(peg$currPos) === 35) {
1032
-        s1 = peg$c32;
1254
+        s1 = peg$c48;
1033 1255
         peg$currPos++;
1034 1256
       } else {
1035 1257
         s1 = peg$FAILED;
1036
-        if (peg$silentFails === 0) { peg$fail(peg$c33); }
1258
+        if (peg$silentFails === 0) { peg$fail(peg$c49); }
1037 1259
       }
1038 1260
       if (s1 !== peg$FAILED) {
1039 1261
         s2 = [];
1040
-        if (peg$c48.test(input.charAt(peg$currPos))) {
1262
+        if (peg$c64.test(input.charAt(peg$currPos))) {
1041 1263
           s3 = input.charAt(peg$currPos);
1042 1264
           peg$currPos++;
1043 1265
         } else {
1044 1266
           s3 = peg$FAILED;
1045
-          if (peg$silentFails === 0) { peg$fail(peg$c49); }
1267
+          if (peg$silentFails === 0) { peg$fail(peg$c65); }
1046 1268
         }
1047 1269
         if (s3 !== peg$FAILED) {
1048 1270
           while (s3 !== peg$FAILED) {
1049 1271
             s2.push(s3);
1050
-            if (peg$c48.test(input.charAt(peg$currPos))) {
1272
+            if (peg$c64.test(input.charAt(peg$currPos))) {
1051 1273
               s3 = input.charAt(peg$currPos);
1052 1274
               peg$currPos++;
1053 1275
             } else {
1054 1276
               s3 = peg$FAILED;
1055
-              if (peg$silentFails === 0) { peg$fail(peg$c49); }
1277
+              if (peg$silentFails === 0) { peg$fail(peg$c65); }
1056 1278
             }
1057 1279
           }
1058 1280
         } else {
... ...
@@ -1060,7 +1282,7 @@ p2c2 = (function() {
1060 1282
         }
1061 1283
         if (s2 !== peg$FAILED) {
1062 1284
           peg$savedPos = s0;
1063
-          s1 = peg$c50(s2);
1285
+          s1 = peg$c66(s2);
1064 1286
           s0 = s1;
1065 1287
         } else {
1066 1288
           peg$currPos = s0;
... ...
@@ -1079,22 +1301,22 @@ p2c2 = (function() {
1079 1301
 
1080 1302
       s0 = peg$currPos;
1081 1303
       s1 = [];
1082
-      if (peg$c51.test(input.charAt(peg$currPos))) {
1304
+      if (peg$c67.test(input.charAt(peg$currPos))) {
1083 1305
         s2 = input.charAt(peg$currPos);
1084 1306
         peg$currPos++;
1085 1307
       } else {
1086 1308
         s2 = peg$FAILED;
1087
-        if (peg$silentFails === 0) { peg$fail(peg$c52); }
1309
+        if (peg$silentFails === 0) { peg$fail(peg$c68); }
1088 1310
       }
1089 1311
       if (s2 !== peg$FAILED) {
1090 1312
         while (s2 !== peg$FAILED) {
1091 1313
           s1.push(s2);
1092
-          if (peg$c51.test(input.charAt(peg$currPos))) {
1314
+          if (peg$c67.test(input.charAt(peg$currPos))) {
1093 1315
             s2 = input.charAt(peg$currPos);
1094 1316
             peg$currPos++;
1095 1317
           } else {
1096 1318
             s2 = peg$FAILED;
1097
-            if (peg$silentFails === 0) { peg$fail(peg$c52); }
1319
+            if (peg$silentFails === 0) { peg$fail(peg$c68); }
1098 1320
           }
1099 1321
         }
1100 1322
       } else {
... ...
@@ -1102,23 +1324,23 @@ p2c2 = (function() {
1102 1324
       }
1103 1325
       if (s1 !== peg$FAILED) {
1104 1326
         if (input.charCodeAt(peg$currPos) === 60) {
1105
-          s2 = peg$c2;
1327
+          s2 = peg$c15;
1106 1328
           peg$currPos++;
1107 1329
         } else {
1108 1330
           s2 = peg$FAILED;
1109
-          if (peg$silentFails === 0) { peg$fail(peg$c3); }
1331
+          if (peg$silentFails === 0) { peg$fail(peg$c16); }
1110 1332
         }
1111 1333
         if (s2 !== peg$FAILED) {
1112 1334
           s3 = peg$currPos;
1113 1335
           peg$silentFails++;
1114 1336
           s4 = peg$parsewhitespaces();
1115 1337
           if (s4 === peg$FAILED) {
1116
-            if (peg$c53.test(input.charAt(peg$currPos))) {
1338
+            if (peg$c69.test(input.charAt(peg$currPos))) {
1117 1339
               s4 = input.charAt(peg$currPos);
1118 1340
               peg$currPos++;
1119 1341
             } else {
1120 1342
               s4 = peg$FAILED;
1121
-              if (peg$silentFails === 0) { peg$fail(peg$c54); }
1343
+              if (peg$silentFails === 0) { peg$fail(peg$c70); }
1122 1344
             }
1123 1345
           }
1124 1346
           peg$silentFails--;
... ...
@@ -1130,7 +1352,7 @@ p2c2 = (function() {
1130 1352
           }
1131 1353
           if (s3 !== peg$FAILED) {
1132 1354
             peg$savedPos = s0;
1133
-            s1 = peg$c55(s1);
1355
+            s1 = peg$c71(s1);
1134 1356
             s0 = s1;
1135 1357
           } else {
1136 1358
             peg$currPos = s0;
... ...
@@ -1152,31 +1374,31 @@ p2c2 = (function() {
1152 1374
       var s0, s1, s2, s3;
1153 1375
 
1154 1376
       s0 = peg$currPos;
1155
-      if (input.substr(peg$currPos, 2) === peg$c56) {
1156
-        s1 = peg$c56;
1377
+      if (input.substr(peg$currPos, 2) === peg$c72) {
1378
+        s1 = peg$c72;
1157 1379
         peg$currPos += 2;
1158 1380
       } else {
1159 1381
         s1 = peg$FAILED;
1160
-        if (peg$silentFails === 0) { peg$fail(peg$c57); }
1382
+        if (peg$silentFails === 0) { peg$fail(peg$c73); }
1161 1383
       }
1162 1384
       if (s1 !== peg$FAILED) {
1163 1385
         s2 = [];
1164
-        if (peg$c58.test(input.charAt(peg$currPos))) {
1386
+        if (peg$c74.test(input.charAt(peg$currPos))) {
1165 1387
           s3 = input.charAt(peg$currPos);
1166 1388
           peg$currPos++;
1167 1389
         } else {
1168 1390
           s3 = peg$FAILED;
1169
-          if (peg$silentFails === 0) { peg$fail(peg$c59); }
1391
+          if (peg$silentFails === 0) { peg$fail(peg$c75); }
1170 1392
         }
1171 1393
         if (s3 !== peg$FAILED) {
1172 1394
           while (s3 !== peg$FAILED) {
1173 1395
             s2.push(s3);
1174
-            if (peg$c58.test(input.charAt(peg$currPos))) {
1396
+            if (peg$c74.test(input.charAt(peg$currPos))) {
1175 1397
               s3 = input.charAt(peg$currPos);
1176 1398
               peg$currPos++;
1177 1399
             } else {
1178 1400
               s3 = peg$FAILED;
1179
-              if (peg$silentFails === 0) { peg$fail(peg$c59); }
1401
+              if (peg$silentFails === 0) { peg$fail(peg$c75); }
1180 1402
             }
1181 1403
           }
1182 1404
         } else {
... ...
@@ -1184,15 +1406,15 @@ p2c2 = (function() {
1184 1406
         }
1185 1407
         if (s2 !== peg$FAILED) {
1186 1408
           if (input.charCodeAt(peg$currPos) === 93) {
1187
-            s3 = peg$c60;
1409
+            s3 = peg$c76;
1188 1410
             peg$currPos++;
1189 1411
           } else {
1190 1412
             s3 = peg$FAILED;
1191
-            if (peg$silentFails === 0) { peg$fail(peg$c61); }
1413
+            if (peg$silentFails === 0) { peg$fail(peg$c77); }
1192 1414
           }
1193 1415
           if (s3 !== peg$FAILED) {
1194 1416
             peg$savedPos = s0;
1195
-            s1 = peg$c62(s1, s2, s3);
1417
+            s1 = peg$c78(s1, s2, s3);
1196 1418
             s0 = s1;
1197 1419
           } else {
1198 1420
             peg$currPos = s0;
... ...
@@ -1213,12 +1435,12 @@ p2c2 = (function() {
1213 1435
     function peg$parsewhitespaces() {
1214 1436
       var s0, s1;
1215 1437
 
1216
-      if (peg$c63.test(input.charAt(peg$currPos))) {
1438
+      if (peg$c79.test(input.charAt(peg$currPos))) {
1217 1439
         s0 = input.charAt(peg$currPos);
1218 1440
         peg$currPos++;
1219 1441
       } else {
1220 1442
         s0 = peg$FAILED;
1221
-        if (peg$silentFails === 0) { peg$fail(peg$c64); }
1443
+        if (peg$silentFails === 0) { peg$fail(peg$c80); }
1222 1444
       }
1223 1445
       if (s0 === peg$FAILED) {
1224 1446
         s0 = peg$currPos;
... ...
@@ -3,7 +3,8 @@ post
3 3
  { return items.join(""); }
4 4
  
5 5
 postItem
6
- = totoz
6
+ = url
7
+ / totoz
7 8
  / canard
8 9
  / bigorno
9 10
  / norloge
... ...
@@ -11,6 +12,10 @@ postItem
11 12
  / closetag
12 13
  / .
13 14
  
15
+url
16
+ = url:$((("http" "s"?) / "ftp") "://" [^ \t\r\n]+)
17
+ {return '<url>' + url + '</url>'}
18
+ 
14 19
 canard
15 20
 = ("\\_" teteCanard "<" / ">" teteCanard "_/")
16 21
  {return '<canard/>';}