MarkTraceur has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/59336


Change subject: Compare category text to unsanitized content
......................................................................

Compare category text to unsanitized content

Messed up the comparison before. This should be more better.

Change-Id: I9617338f3845f64f80e1174bbdfa709a6124fd7c
---
M js/lib/ext.core.LinkHandler.js
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/36/59336/1

diff --git a/js/lib/ext.core.LinkHandler.js b/js/lib/ext.core.LinkHandler.js
index a043162..cc51a1c 100644
--- a/js/lib/ext.core.LinkHandler.js
+++ b/js/lib/ext.core.LinkHandler.js
@@ -113,7 +113,7 @@
 WikiLinkHandler.prototype.onWikiLink = function ( token, frame, cb ) {
 
        var j, maybeContent, about, possibleTags, property, newType,
-               hrefkv, saniContent, env = this.manager.env,
+               hrefkv, saniContent, strContent, env = this.manager.env,
                attribs = token.attribs,
                hrefSrc = Util.lookupKV( token.attribs, 'href' ).vsrc,
                target = Util.lookup( attribs, 'href' ),
@@ -158,7 +158,6 @@
                var tokens = [];
 
                if ( title.ns.isCategory() && ! href.match(/^:/) ) {
-
                        // We let this get handled earlier as a normal 
wikilink, but we need
                        // to add in a few extras.
                        obj = new SelfclosingTagTk('link', obj.attribs, 
obj.dataAttribs);
@@ -166,10 +165,11 @@
                        // Change the rel to be mw:WikiLink/Category
                        Util.lookupKV( obj.attribs, 'rel' ).v += '/Category';
 
-                       saniContent = Util.sanitizeTitleURI( 
Util.tokensToString( content ) ).replace( /#/g, '%23' );
+                       strContent = Util.tokensToString( content );
+                       saniContent = Util.sanitizeTitleURI( strContent 
).replace( /#/g, '%23' );
 
                        // Change the href to include the sort key, if any
-                       if ( saniContent && saniContent !== '' && saniContent 
!== href ) {
+                       if ( strContent && strContent !== '' && strContent !== 
href ) {
                                hrefkv = Util.lookupKV( obj.attribs, 'href' );
                                hrefkv.v += '#';
                                hrefkv.v += saniContent;

-- 
To view, visit https://gerrit.wikimedia.org/r/59336
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9617338f3845f64f80e1174bbdfa709a6124fd7c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>

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

Reply via email to