r113140 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113139‎ | r113140 | r113141 >
Date:14:32, 6 March 2012
Author:gwicke
Status:deferred
Tags:
Comment:
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 (modified) (history)
  • /trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt (modified) (history)
  • /trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/parser/parserTests-whitelist.js
@@ -62,7 +62,9 @@
6363
6464 testWhiteList["<pre> with forbidden attribute values (bug 3202)"] = "<pre width=\"8\" style=\"\">Narrow screen goodies</pre>";
6565
66 -//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>";
 66+// This is valid, just confusing for humans. The reason for disallowing this
 67+// might be history by now. XXX: Check this!
 68+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>";
6769
6870 if (typeof module == "object") {
6971 module.exports.testWhiteList = testWhiteList;
Index: trunk/extensions/VisualEditor/modules/parser/pegTokenizer.pegjs.txt
@@ -1385,7 +1385,7 @@
13861386
13871387 table_cell_args
13881388 = & { return setFlag('tableCellArg'); }
1389 - as:generic_attribute+ space* "|" !"|" {
 1389+ as:generic_attribute* space* "|" !"|" {
13901390 clearFlag('tableCellArg');
13911391 return as;
13921392 }
Index: trunk/extensions/VisualEditor/modules/parser/ext.core.LinkHandler.js
@@ -244,7 +244,7 @@
245245 var href = this.manager.env.lookupKV( token.attribs, 'href' ).v,
246246 content= this.manager.env.lookupKV( token.attribs, 'content' ).v;
247247 href = this.manager.env.sanitizeURI( href );
248 - console.warn('extlink href: ' + href );
 248+ //console.warn('extlink href: ' + href );
249249 //console.warn( 'content: ' + JSON.stringify( content, null, 2 ) );
250250 // validate the href
251251 if ( this.imageParser.parseURL( href ) ) {
Index: trunk/extensions/VisualEditor/modules/parser/mediawiki.parser.environment.js
@@ -222,7 +222,7 @@
223223 var host = s.match(/^[a-zA-Z]+:\/\/[^\/]+(?:\/|$)/),
224224 path = s,
225225 anchor = null;
226 - console.warn( 'host: ' + host );
 226+ //console.warn( 'host: ' + host );
227227 if ( host ) {
228228 path = s.substr( host[0].length );
229229 host = host[0];

Status & tagging log