diff --git a/modules/parser/ext.core.Sanitizer.js b/modules/parser/ext.core.Sanitizer.js index f9fd257205..54220440bb 100644 --- a/modules/parser/ext.core.Sanitizer.js +++ b/modules/parser/ext.core.Sanitizer.js @@ -86,7 +86,7 @@ Sanitizer.prototype._stripIDNs = function ( host ) { * Sanitize any tag. * * XXX: Make attribute sanitation reversible by storing round-trip info in - * token.dataAttribs object (which is serialized as JSON in a data-mw + * token.dataAttribs object (which is serialized as JSON in a data-rt * attribute in the DOM). */ Sanitizer.prototype.onAny = function ( token ) { diff --git a/modules/parser/mediawiki.HTML5TreeBuilder.node.js b/modules/parser/mediawiki.HTML5TreeBuilder.node.js index dd2c0aad09..053b8a38b8 100644 --- a/modules/parser/mediawiki.HTML5TreeBuilder.node.js +++ b/modules/parser/mediawiki.HTML5TreeBuilder.node.js @@ -81,7 +81,7 @@ FauxHTML5.TreeBuilder.prototype.processToken = function (token) { attribs = attribs.concat([ { // Mediawiki-specific round-trip / non-semantic information - k: 'data-mw', + k: 'data-rt', v: dataMW } ] ); } diff --git a/modules/parser/mediawiki.LinearModelConverter.js b/modules/parser/mediawiki.LinearModelConverter.js index caec7a65c6..3c5c771ee9 100644 --- a/modules/parser/mediawiki.LinearModelConverter.js +++ b/modules/parser/mediawiki.LinearModelConverter.js @@ -90,7 +90,7 @@ var annotationTypes = { 'span': 'textStyle/span', 'a': function( node ) { // FIXME the parser currently doesn't output this data this way - // Internal links get linkType:'internal' in the data-mw-rt attrib, + // Internal links get linkType:'internal' in the data-rt attrib, // external links get nothing var atype = node.getAttribute( 'data-type' ); if ( atype ) { diff --git a/modules/parser/mediawiki.WikitextSerializer.js b/modules/parser/mediawiki.WikitextSerializer.js index 31910de569..f21b56c35a 100644 --- a/modules/parser/mediawiki.WikitextSerializer.js +++ b/modules/parser/mediawiki.WikitextSerializer.js @@ -654,7 +654,7 @@ WSP.tagHandlers = { if ( state.prevToken.constructor === TagTk && state.prevToken.name === 'tbody' ) { // Omit for first row in a table. XXX: support optional trs // for first line (in source wikitext) too using some flag in - // data-mw (stx: 'wikitext' ?) + // data-rt (stx: 'wikitext' ?) return ''; } else { return WSP._serializeTableTag("|-", '', state, token ); @@ -1300,7 +1300,7 @@ WSP._getDOMAttribs = function( attribs ) { var out = []; for ( var i = 0, l = attribs.length; i < l; i++ ) { var attrib = attribs.item(i); - if ( attrib.name !== 'data-mw' ) { + if ( attrib.name !== 'data-rt' ) { out.push( { k: attrib.name, v: attrib.value } ); } } @@ -1308,8 +1308,8 @@ WSP._getDOMAttribs = function( attribs ) { }; WSP._getDOMRTInfo = function( attribs ) { - if ( attribs['data-mw'] ) { - return JSON.parse( attribs['data-mw'].value || '{}' ); + if ( attribs['data-rt'] ) { + return JSON.parse( attribs['data-rt'].value || '{}' ); } else { return {}; } diff --git a/tests/parser/parserTests-whitelist.js b/tests/parser/parserTests-whitelist.js index 851ec051b1..d806b3436e 100644 --- a/tests/parser/parserTests-whitelist.js +++ b/tests/parser/parserTests-whitelist.js @@ -51,7 +51,7 @@ testWhiteList["Invalid attributes in table cell (bug 1830)"] = "
|[1]\" onmouseover=\"alert(document.cookie)\">test |
La muerte de Casagemas (1901) en el sitio de Museo Picasso.
"; +testWhiteList["External link containing double-single-quotes with no space separating the url from text in italics"] = "La muerte de Casagemas (1901) en el sitio de Museo Picasso.
"; testWhiteList["External links: wiki links within external link (Bug 3695)"] = "wikilink embedded in ext link
"; diff --git a/tests/parser/parserTests.js b/tests/parser/parserTests.js index 36e7f27710..1e4f3a4f10 100644 --- a/tests/parser/parserTests.js +++ b/tests/parser/parserTests.js @@ -340,7 +340,7 @@ ParserTests.prototype.normalizeOut = function ( out ) { return out .replace(/]*>((?:[^<]+|(?!<\/span).)*)<\/span>/g, '$1') - .replace(/[\r\n]| (data-mw|typeof|resource|rel|prefix|about|rev|datatype|inlist|property|vocab|content)="[^">]*"/g, '') + .replace(/[\r\n]| (data-rt|typeof|resource|rel|prefix|about|rev|datatype|inlist|property|vocab|content)="[^">]*"/g, '') .replace(/\n?/gm, '') .replace(/<\/?meta[^>]*>/g, ''); };