Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -695,29 +695,32 @@ |
696 | 696 | } |
697 | 697 | |
698 | 698 | extlink |
699 | | - = "[" |
700 | | - & { return setFlag('extlink'); } |
701 | | - //target:urllink |
702 | | - target:link_preprocessor_text |
703 | | - text:(space* t:inlineline { return t } )? |
704 | | - "]" { |
705 | | - clearFlag('extlink'); |
706 | | - if ( text == '' ) { |
707 | | - // XXX: Link numbering should be implemented in post-processor. |
708 | | - text = [ "[" + linkCount + "]" ]; |
709 | | - linkCount++; |
| 699 | + = ! { return syntaxFlags['extlink'] } // extlink cannot be nested |
| 700 | + ( |
| 701 | + "[" |
| 702 | + & { return setFlag('extlink'); } |
| 703 | + //target:urllink |
| 704 | + target:link_preprocessor_text |
| 705 | + text:(space* t:inlineline { return t } )? |
| 706 | + "]" { |
| 707 | + clearFlag('extlink'); |
| 708 | + if ( text === '' ) { |
| 709 | + // XXX: Link numbering should be implemented in post-processor. |
| 710 | + text = [ "[" + linkCount + "]" ]; |
| 711 | + linkCount++; |
| 712 | + } |
| 713 | + var res = [ |
| 714 | + new TagTk( 'a', [ |
| 715 | + new KV('href', target), |
| 716 | + new KV('data-type', 'external') |
| 717 | + ] ), |
| 718 | + ].concat( text |
| 719 | + , [ new EndTagTk( 'a' )]); |
| 720 | + //console.log( JSON.stringify( res, null, 2 ) ); |
| 721 | + return res; |
710 | 722 | } |
711 | | - var res = [ |
712 | | - new TagTk( 'a', [ |
713 | | - new KV('href', target), |
714 | | - new KV('data-type', 'external') |
715 | | - ] ), |
716 | | - ].concat( text |
717 | | - , [ new EndTagTk( 'a' )]); |
718 | | - //console.log( JSON.stringify( res, null, 2 ) ); |
719 | | - return res; |
720 | | - } |
721 | | - / "[" & { clearFlag('extlink'); return false; } |
| 723 | + / "[" & { clearFlag('extlink'); return false; } |
| 724 | + ) |
722 | 725 | |
723 | 726 | /* Defaul URL protocols in MediaWiki (see DefaultSettings). Normally these can |
724 | 727 | * be configured dynamically. */ |