jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/370234 )

Change subject: Revert "Bring back anchorencode and locutus dependency"
......................................................................


Revert "Bring back anchorencode and locutus dependency"

This reverts commit e3b9910

Bug: T172548
Change-Id: Ifd2b8cec2376dda0c4fe77746548f8f0934ad318
---
D lib/anchorencode.js
M package.json
D test/lib/anchorencode/anchorencode-test.js
3 files changed, 0 insertions(+), 65 deletions(-)

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



diff --git a/lib/anchorencode.js b/lib/anchorencode.js
deleted file mode 100644
index bfe2c53..0000000
--- a/lib/anchorencode.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-const urlencode = require('locutus/php/url/urlencode');
-
-/**
- * Encodes an input string so that it can be used as an HTML anchor id
- * (e.g. for a section in a page: <h2 id="anchor">).
- * See 
https://www.mediawiki.org/wiki/Manual:PAGENAMEE_encoding#Encodings_compared
- * https://www.mediawiki.org/wiki/Special:Code/MediaWiki/16279
- * core/include/parser/CoreParserFunctions.php
- * https://phabricator.wikimedia.org/T9059
- * https://gerrit.wikimedia.org/r/#/c/226032/
- * @param {!string} input the input string (usually the heading text of a 
section heading)
- * @return {!string} the sanitized version of the input string so it can be 
used as an anchor.
- */
-function anchorencode(input) {
-    const id = input.replace(/\s+/g, '_');
-    return urlencode(id)
-        .replace(/%3A/g, ':')
-        .replace(/%/g, '.');
-}
-
-module.exports = anchorencode;
diff --git a/package.json b/package.json
index 6dbcb37..ace1ab6 100644
--- a/package.json
+++ b/package.json
@@ -50,7 +50,6 @@
     "express": "^4.14.0",
     "js-yaml": "^3.7.0",
     "mediawiki-title": "^0.6.3",
-    "locutus": "^2.0.5",
     "preq": "^0.5.1",
     "service-runner": "^2.2.5",
     "swagger-router": "^0.5.5",
diff --git a/test/lib/anchorencode/anchorencode-test.js 
b/test/lib/anchorencode/anchorencode-test.js
deleted file mode 100644
index 9c23c1c..0000000
--- a/test/lib/anchorencode/anchorencode-test.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-const assert = require('../../utils/assert.js');
-const anchorencode = require('../../../lib/anchorencode');
-
-describe('lib:anchorencode', function() {
-
-    this.timeout(20000); // eslint-disable-line no-invalid-this
-
-    it('anchorencode(empty) should return an empty string', () => {
-        assert.deepEqual(anchorencode(''), '');
-    });
-
-    it('anchorencode("a") should return a', () => {
-        assert.deepEqual(anchorencode('a'), 'a');
-    });
-
-    it('anchorencode("Z") should return Z', () => {
-        assert.deepEqual(anchorencode('Z'), 'Z');
-    });
-
-    it('anchorencode("  Z  ") should return Z', () => {
-        assert.deepEqual(anchorencode('  Z  '), 'Z');
-    });
-
-    it('anchorencode("a b c") should return a_b_c', () => {
-        assert.deepEqual(anchorencode('a b c'), 'a_b_c');
-    });
-
-    it('anchorencode("a  b  c") should return a_b_c', () => {
-        assert.deepEqual(anchorencode('a  b  c'), 'a_b_c');
-    });
-
-    it('anchorencode("!@#$%^&*()") should return 
21.40.23.24.25.5E.26.2A.28.29', () => {
-        assert.deepEqual(anchorencode('!@#$%^&*()'), 
'21.40.23.24.25.5E.26.2A.28.29');
-    });
-
-    it('anchorencode(":") should not be converted', () => {
-        assert.deepEqual(anchorencode(':'), ':');
-    });
-});

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd2b8cec2376dda0c4fe77746548f8f0934ad318
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: BearND <bsitzm...@wikimedia.org>
Gerrit-Reviewer: Dbrant <dbr...@wikimedia.org>
Gerrit-Reviewer: Fjalapeno <cfl...@wikimedia.org>
Gerrit-Reviewer: GWicke <gwi...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: Jhernandez <jhernan...@wikimedia.org>
Gerrit-Reviewer: Mholloway <mhollo...@wikimedia.org>
Gerrit-Reviewer: Mhurd <mh...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: Ppchelko <ppche...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to