jenkins-bot has submitted this change and it was merged.

Change subject: Make URL schemes case-insensitive
......................................................................


Make URL schemes case-insensitive

Bug: T109013
Change-Id: I0cbe71ff1ad6245afec88ee6f70b8d30d6e07f02
---
M src/init/sa/ve.init.sa.Platform.js
M src/ui/actions/ve.ui.LinkAction.js
M tests/ui/actions/ve.ui.LinkAction.test.js
3 files changed, 16 insertions(+), 3 deletions(-)

Approvals:
  Jforrester: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/init/sa/ve.init.sa.Platform.js 
b/src/init/sa/ve.init.sa.Platform.js
index 76452b9..6de2b90 100644
--- a/src/init/sa/ve.init.sa.Platform.js
+++ b/src/init/sa/ve.init.sa.Platform.js
@@ -26,8 +26,8 @@
        ve.init.Platform.call( this );
 
        // Properties
-       this.externalLinkUrlProtocolsRegExp = /^https?\:\/\//;
-       this.unanchoredExternalLinkUrlProtocolsRegExp = /https?\:\/\//;
+       this.externalLinkUrlProtocolsRegExp = /^https?\:\/\//i;
+       this.unanchoredExternalLinkUrlProtocolsRegExp = /https?\:\/\//i;
        this.messagePaths = messagePaths || [];
        this.parsedMessages = {};
        this.userLanguages = [ 'en' ];
diff --git a/src/ui/actions/ve.ui.LinkAction.js 
b/src/ui/actions/ve.ui.LinkAction.js
index 4e118a2..2684b03 100644
--- a/src/ui/actions/ve.ui.LinkAction.js
+++ b/src/ui/actions/ve.ui.LinkAction.js
@@ -120,7 +120,8 @@
 
        ve.ui.LinkAction.static.autolinkRegExp =
                new RegExp(
-                       '\\b' + 
ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + 
'\\S+(\\s|\\n\\n)$'
+                       '\\b' + 
ve.init.platform.getUnanchoredExternalLinkUrlProtocolsRegExp().source + 
'\\S+(\\s|\\n\\n)$',
+                       'i'
                );
 
        ve.ui.sequenceRegistry.register(
diff --git a/tests/ui/actions/ve.ui.LinkAction.test.js 
b/tests/ui/actions/ve.ui.LinkAction.test.js
index 5c92a34..b3d0941 100644
--- a/tests/ui/actions/ve.ui.LinkAction.test.js
+++ b/tests/ui/actions/ve.ui.LinkAction.test.js
@@ -56,6 +56,18 @@
                                        }
                                },
                                msg: 'Autolink after newline'
+                       },
+                       {
+                               html: '<p>Http://Example.COm xyz</p>',
+                               range: new ve.Range( 1, 20 ),
+                               method: 'autolinkUrl',
+                               expectedRange: new ve.Range( 20, 20 ),
+                               expectedData: function ( data ) {
+                                       for ( var i = 1; i < 19; i++ ) {
+                                               data[i] = [ data[i], [ 0 ] ];
+                                       }
+                               },
+                               msg: 'Autolink with mixed case'
                        }
                ];
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I0cbe71ff1ad6245afec88ee6f70b8d30d6e07f02
Gerrit-PatchSet: 3
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to