Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -674,6 +674,7 @@ |
675 | 675 | |
676 | 676 | url |
677 | 677 | = proto:url_protocol |
| 678 | + addr:( ipv6_address / ipv4_address )? |
678 | 679 | rest:( ( !inline_breaks |
679 | 680 | c:no_punctuation_char |
680 | 681 | { return c } |
— | — | @@ -683,9 +684,21 @@ |
684 | 685 | / urlencoded_char |
685 | 686 | / [&%] )+ |
686 | 687 | { |
687 | | - return proto + rest.join(''); |
| 688 | + return proto + addr + rest.join(''); |
688 | 689 | } |
689 | 690 | |
| 691 | +ipv4_address |
| 692 | + = a:([0-9]* '.' [0-9]* '.' [0-9]* '.' [0-9]*) |
| 693 | +{ |
| 694 | + return flatten( a ).join(''); |
| 695 | +} |
| 696 | + |
| 697 | +ipv6_address |
| 698 | + = a:('[' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ':' [0-9]* ']') |
| 699 | +{ |
| 700 | + return flatten( a ).join(''); |
| 701 | +} |
| 702 | + |
690 | 703 | template |
691 | 704 | = "{{" target:template_param_text |
692 | 705 | params:(newline? "|" newline? p:template_param { return p })* |