Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -432,17 +432,17 @@ |
433 | 433 | * The actual contents of each block. |
434 | 434 | */ |
435 | 435 | block |
436 | | - = block_lines |
| 436 | + = block_lines |
437 | 437 | / & '<' r:( pre // tag variant can start anywhere |
438 | 438 | / comment &eolf |
439 | 439 | / nowiki |
440 | 440 | // avoid a paragraph if we know that the line starts with a block tag |
441 | 441 | / bt:block_tag { return [bt] } |
442 | 442 | ) { return r; } |
443 | | - / para |
| 443 | + / paragraph |
444 | 444 | // Inlineline includes generic tags; wrapped into paragraphs in token |
445 | 445 | // transform and DOM postprocessor |
446 | | - / inlineline |
| 446 | + / inlineline |
447 | 447 | / sol |
448 | 448 | |
449 | 449 | /* |
— | — | @@ -484,9 +484,9 @@ |
485 | 485 | /* |
486 | 486 | * A paragraph. We don't emit 'p' tokens to avoid issues with template |
487 | 487 | * transclusions, <p> tags in the source and the like. Instead, we perform |
488 | | - * some paragraph wrapping on the DOM. |
| 488 | + * some paragraph wrapping on the token stream and the DOM. |
489 | 489 | */ |
490 | | -para |
| 490 | +paragraph |
491 | 491 | = s1:sol s2:sol c:inlineline { |
492 | 492 | return s1.concat(s2, /* [new TagTk('p')],*/ c); |
493 | 493 | } |
— | — | @@ -794,7 +794,7 @@ |
795 | 795 | // FIXME: handle template args and templates in key! (or even parser functions?) |
796 | 796 | template_param_name |
797 | 797 | = & { return stops.push( 'equal', true ) } |
798 | | - tpt:template_param_text |
| 798 | + tpt:(template_param_text / &'=' { return '' }) |
799 | 799 | { |
800 | 800 | stops.pop( 'equal' ); |
801 | 801 | //console.warn( 'template param name matched: ' + pp( tpt ) ); |
— | — | @@ -815,8 +815,14 @@ |
816 | 816 | / & { return stops.pop( 'equal' ) } |
817 | 817 | |
818 | 818 | template_param_text |
819 | | - = & { stops.push('table', false ); return stops.inc('template') } |
820 | | - il:( inline / nested_block )+ { |
| 819 | + = & { /*console.warn( 'tpt: ' + |
| 820 | + input.substr( pos - 10, 9) + |
| 821 | + input[pos].green + |
| 822 | + input.substr( pos +1, 9) ); */ |
| 823 | + stops.push('table', false ); |
| 824 | + return stops.inc('template') |
| 825 | + } |
| 826 | + il:nested_block+ { |
821 | 827 | stops.pop('table'); |
822 | 828 | stops.dec('template'); |
823 | 829 | //console.warn( 'tpt match: ' + pp (il)); |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.tokenizer.peg.js |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | fs = require('fs'), |
14 | 14 | $ = require('jquery'), |
15 | 15 | events = require('events'), |
| 16 | + //colors = require('colors'), |
16 | 17 | defines = require('./mediawiki.parser.defines.js'); |
17 | 18 | |
18 | 19 | function PegTokenizer() { |