diff --git a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js index 5ad9493316..648b6cf05c 100644 --- a/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js +++ b/modules/ve-mw/dm/metaitems/ve.dm.MWCategoryMetaItem.js @@ -30,14 +30,10 @@ ve.dm.MWCategoryMetaItem.static.group = 'mwCategory'; ve.dm.MWCategoryMetaItem.static.matchTagNames = [ 'link' ]; -ve.dm.MWCategoryMetaItem.static.matchRdfaTypes = [ - 'mw:WikiLink/Category', // old type, pre-bug 53432 - 'mw:PageProp/Category' // new type -]; +ve.dm.MWCategoryMetaItem.static.matchRdfaTypes = [ 'mw:PageProp/Category' ]; ve.dm.MWCategoryMetaItem.static.toDataElement = function ( domElements ) { - var firstDomElement = domElements[0], - href = firstDomElement.getAttribute( 'href' ), + var href = domElements[0].getAttribute( 'href' ), /*jshint regexp:false */ matches = href.match( /^((?:\.\.?\/)*)(.*?)(?:#(.*))?$/ ), rawSortkey = matches[3] || ''; @@ -48,8 +44,7 @@ ve.dm.MWCategoryMetaItem.static.toDataElement = function ( domElements ) { 'category': decodeURIComponent( matches[2] ).replace( /_/g, ' ' ), 'origCategory': matches[2], 'sortkey': decodeURIComponent( rawSortkey ).replace( /_/g, ' ' ), - 'origSortkey': rawSortkey, - 'origRel': firstDomElement.getAttribute( 'rel' ) + 'origSortkey': rawSortkey } }; }; @@ -74,7 +69,7 @@ ve.dm.MWCategoryMetaItem.static.toDomElements = function ( dataElement, doc ) { } else { category = encodeURIComponent( category ); } - domElement.setAttribute( 'rel', dataElement.attributes.origRel || 'mw:WikiLink/Category' ); + domElement.setAttribute( 'rel', 'mw:PageProp/Category' ); href = hrefPrefix + category; if ( sortkey !== '' ) { href += '#' + sortkey; diff --git a/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js b/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js index 2c7d074940..3fd1190a33 100644 --- a/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js +++ b/modules/ve-mw/dm/metaitems/ve.dm.MWLanguageMetaItem.js @@ -28,26 +28,21 @@ ve.dm.MWLanguageMetaItem.static.name = 'mwLanguage'; ve.dm.MWLanguageMetaItem.static.matchTagNames = [ 'link' ]; -ve.dm.MWLanguageMetaItem.static.matchRdfaTypes = [ - 'mw:WikiLink/Language', // old type, pre-bug 53432 - 'mw:PageProp/Language' // new type -]; +ve.dm.MWLanguageMetaItem.static.matchRdfaTypes = [ 'mw:PageProp/Language' ]; ve.dm.MWLanguageMetaItem.static.toDataElement = function ( domElements ) { - var firstDomElement = domElements[0], - href = firstDomElement.getAttribute( 'href' ); + var href = domElements[0].getAttribute( 'href' ); return { 'type': 'mwLanguage', 'attributes': { - 'href': href, - 'origRel': firstDomElement.getAttribute( 'rel' ) + 'href': href } }; }; ve.dm.MWLanguageMetaItem.static.toDomElements = function ( dataElement, doc ) { var domElement = doc.createElement( 'link' ); - domElement.setAttribute( 'rel', dataElement.attributes.origRel || 'mw:WikiLink/Language' ); + domElement.setAttribute( 'rel', 'mw:PageProp/Language' ); domElement.setAttribute( 'href', dataElement.attributes.href ); return [ domElement ]; }; diff --git a/modules/ve-mw/test/dm/ve.dm.mwExample.js b/modules/ve-mw/test/dm/ve.dm.mwExample.js index 809a7b1354..0bdab61769 100644 --- a/modules/ve-mw/test/dm/ve.dm.mwExample.js +++ b/modules/ve-mw/test/dm/ve.dm.mwExample.js @@ -24,14 +24,14 @@ ve.dm.mwExample.MWTransclusion = { 'inlineOpenModified': '', 'inlineContent': '$1,234.00', 'inlineClose': '', - 'mixed': 'Foo', + 'mixed': 'Foo', 'pairOne': '

foo

', 'pairTwo': '

foo

', 'meta': - '' + '\n' + - '' + '' }; ve.dm.mwExample.MWTransclusion.blockData = { 'type': 'mwTransclusionBlock', @@ -98,7 +98,7 @@ ve.dm.mwExample.MWTransclusion.mixedDataOpen = { 'htmlAttributes': [ { 'values': { 'about': '#mwt1', - 'rel': 'mw:WikiLink/Category', + 'rel': 'mw:PageProp/Category', 'typeof': 'mw:Transclusion', 'data-mw': '{\"id\":\"mwt1\",\"target\":{\"wt\":\"Inline\"},\"params\":{\"1\":{\"wt\":\"5,678\"}}}' } }, @@ -255,8 +255,7 @@ ve.dm.mwExample.withMeta = [ 'category': 'Category:Bar', 'origCategory': 'Category:Bar', 'sortkey': '', - 'origSortkey': '', - 'origRel': 'mw:PageProp/Category' + 'origSortkey': '' }, 'htmlAttributes': [ { @@ -313,8 +312,7 @@ ve.dm.mwExample.withMeta = [ 'category': 'Category:Foo foo', 'origCategory': 'Category:Foo_foo', 'sortkey': 'Bar baz#quux', - 'origSortkey': 'Bar baz%23quux', - 'origRel': 'mw:PageProp/Category' + 'origSortkey': 'Bar baz%23quux' }, 'htmlAttributes': [ @@ -388,7 +386,7 @@ ve.dm.mwExample.withMetaMetaData = [ 'htmlAttributes': [ { 'values': { - 'rel': 'mw:WikiLink/Category', + 'rel': 'mw:PageProp/Category', 'href': './Category:Bar' }, 'computed': { @@ -441,7 +439,7 @@ ve.dm.mwExample.withMetaMetaData = [ 'origSortkey': 'Bar baz%23quux' }, 'htmlAttributes': [ { 'values': { - 'rel': 'mw:WikiLink/Category', + 'rel': 'mw:PageProp/Category', 'href': './Category:Foo_foo#Bar baz%23quux' } } ] }, @@ -1553,7 +1551,7 @@ ve.dm.mwExample.domToDataCases = { }, 'whitespace preservation with wrapped comments and language links': { 'body': 'Foo\n' + - '\n' + + '\n' + '', 'data': [ { @@ -1570,14 +1568,13 @@ ve.dm.mwExample.domToDataCases = { { 'type': 'mwLanguage', 'attributes': { - 'href': 'http://de.wikipedia.org/wiki/Foo', - 'origRel': 'mw:WikiLink/Language' + 'href': 'http://de.wikipedia.org/wiki/Foo' }, 'htmlAttributes': [ { 'values': { 'href': 'http://de.wikipedia.org/wiki/Foo', - 'rel': 'mw:WikiLink/Language' + 'rel': 'mw:PageProp/Language' }, 'computed': { 'href': 'http://de.wikipedia.org/wiki/Foo' @@ -1590,8 +1587,7 @@ ve.dm.mwExample.domToDataCases = { { 'type': 'mwLanguage', 'attributes': { - 'href': 'http://fr.wikipedia.org/wiki/Foo', - 'origRel': 'mw:PageProp/Language' + 'href': 'http://fr.wikipedia.org/wiki/Foo' }, 'htmlAttributes': [ {