Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt |
— | — | @@ -455,7 +455,7 @@ |
456 | 456 | } |
457 | 457 | |
458 | 458 | link_preprocessor_text |
459 | | - = r:( t:[^'<~[{\n\r|!\]}\t &="']+ { return t.join(''); } |
| 459 | + = r:( t:[^'<~[{\n\r|!\]}\t&="' \u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]+ { return t.join(''); } |
460 | 460 | / directive |
461 | 461 | / urlencoded_char |
462 | 462 | / !inline_breaks no_punctuation_char |
— | — | @@ -734,7 +734,8 @@ |
735 | 735 | & { return setFlag('extlink'); } |
736 | 736 | //target:urllink |
737 | 737 | target:link_preprocessor_text |
738 | | - text:(space* t:inlineline { return t } )? |
| 738 | + text:(( space / [\u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000] )* |
| 739 | + t:inlineline { return t } )? |
739 | 740 | "]" { |
740 | 741 | clearFlag('extlink'); |
741 | 742 | if ( text === '' ) { |
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js |
— | — | @@ -87,6 +87,17 @@ |
88 | 88 | throw new Error('nooooooooo not a string'); |
89 | 89 | } |
90 | 90 | name = name.trim().replace(/[\s_]+/g, '_'); |
| 91 | + |
| 92 | + // Implement int: as alias for MediaWiki: |
| 93 | + if ( name.substr( 0, 4 ) === 'int:' ) { |
| 94 | + name = 'MediaWiki:' + name.substr( 4 ); |
| 95 | + } |
| 96 | + |
| 97 | + // FIXME: Generalize namespace case normalization |
| 98 | + if ( name.substr( 0, 10 ).toLowerCase() === 'mediawiki:' ) { |
| 99 | + name = 'MediaWiki:' + name.substr( 10 ); |
| 100 | + } |
| 101 | + |
91 | 102 | function upperFirst( s ) { return s.substr(0, 1).toUpperCase() + s.substr(1); } |
92 | 103 | name = name.split(':').map( upperFirst ).join(':'); |
93 | 104 | //if (name === '') { |