https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113140

Revision: 113140
Author:   gwicke
Date:     2012-03-06 14:32:45 +0000 (Tue, 06 Mar 2012)
Log Message:
-----------
Accept empty table cell attribute sections, and consider percent-encoded %2525
valid. 270 tests passing.

Modified Paths:
--------------
    trunk/extensions/VisualEditor/modules/parser/ext.core.LinkHandler.js
    trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js
    trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
    trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js

Modified: trunk/extensions/VisualEditor/modules/parser/ext.core.LinkHandler.js
===================================================================
--- trunk/extensions/VisualEditor/modules/parser/ext.core.LinkHandler.js        
2012-03-06 14:31:26 UTC (rev 113139)
+++ trunk/extensions/VisualEditor/modules/parser/ext.core.LinkHandler.js        
2012-03-06 14:32:45 UTC (rev 113140)
@@ -244,7 +244,7 @@
        var href = this.manager.env.lookupKV( token.attribs, 'href' ).v,
                content=  this.manager.env.lookupKV( token.attribs, 'content' 
).v;
        href = this.manager.env.sanitizeURI( href );
-       console.warn('extlink href: ' + href );
+       //console.warn('extlink href: ' + href );
        //console.warn( 'content: ' + JSON.stringify( content, null, 2 ) );
        // validate the href
        if ( this.imageParser.parseURL( href ) ) {

Modified: 
trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js
===================================================================
--- 
trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js    
    2012-03-06 14:31:26 UTC (rev 113139)
+++ 
trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js    
    2012-03-06 14:32:45 UTC (rev 113140)
@@ -222,7 +222,7 @@
        var host = s.match(/^[a-zA-Z]+:\/\/[^\/]+(?:\/|$)/),
                path = s,
                anchor = null;
-       console.warn( 'host: ' + host );
+       //console.warn( 'host: ' + host );
        if ( host ) {
                path = s.substr( host[0].length );
                host = host[0];

Modified: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
===================================================================
--- trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt 
2012-03-06 14:31:26 UTC (rev 113139)
+++ trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt 
2012-03-06 14:32:45 UTC (rev 113140)
@@ -1385,7 +1385,7 @@
 
 table_cell_args
   = & { return setFlag('tableCellArg'); }
-    as:generic_attribute+ space* "|" !"|" { 
+    as:generic_attribute* space* "|" !"|" { 
         clearFlag('tableCellArg');
         return as;
     }

Modified: trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js
===================================================================
--- trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js 
2012-03-06 14:31:26 UTC (rev 113139)
+++ trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js 
2012-03-06 14:32:45 UTC (rev 113140)
@@ -62,7 +62,9 @@
 
 testWhiteList["<pre> with forbidden attribute values (bug 3202)"] = "<pre 
width=\"8\" style=\"\">Narrow screen goodies</pre>";
 
-//testWhiteList["Piped link to URL"] = "<p>Piped link to URL: [<a 
href=\"http://www.example.com|an\" data-mw-type=\"external\">example 
URL</a>]</p>";
+// This is valid, just confusing for humans. The reason for disallowing this
+// might be history by now. XXX: Check this!
+testWhiteList["Link containing % as a double hex sequence interpreted to hex 
sequence"] = "<p><a href=\"/wiki/7%2525_Solution\" 
data-mw-type=\"internal\">7%25 Solution</a></p>";
 
 if (typeof module == "object") {
        module.exports.testWhiteList = testWhiteList;


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to