r110830 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110829‎ | r110830 | r110831 >
Date:09:38, 7 February 2012
Author:gwicke
Status:deferred
Tags:
Comment:
External links don't nest.
Modified paths:
  • /trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
@@ -695,29 +695,32 @@
696696 }
697697
698698 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;
710722 }
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+ )
722725
723726 /* Defaul URL protocols in MediaWiki (see DefaultSettings). Normally these can
724727 * be configured dynamically. */

Status & tagging log