From 6b09c3e9e6db7ceaf1c5c2ebf3ba8d5c63dbfe87 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 30 Sep 2019 21:03:16 -0600 Subject: [PATCH] Appease the linter --- src/linkify-matrix.js | 7 ------- src/utils/permalinks/Permalinks.js | 6 ++++-- src/utils/permalinks/RiotPermalinkConstructor.js | 1 - 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/linkify-matrix.js b/src/linkify-matrix.js index 1ec2434bf0..fabd9d15ad 100644 --- a/src/linkify-matrix.js +++ b/src/linkify-matrix.js @@ -191,13 +191,6 @@ matrixLinkify.MATRIXTO_MD_LINK_PATTERN = '\\[([^\\]]*)\\]\\((?:https?://)?(?:www\\.)?matrix\\.to/#/([#@!+][^\\)]*)\\)'; matrixLinkify.MATRIXTO_BASE_URL= baseUrl; -const matrixToEntityMap = { - '@': '#/user/', - '#': '#/room/', - '!': '#/room/', - '+': '#/group/', -}; - matrixLinkify.options = { events: function(href, type) { switch (type) { diff --git a/src/utils/permalinks/Permalinks.js b/src/utils/permalinks/Permalinks.js index 4cac095ca0..19dcbd062a 100644 --- a/src/utils/permalinks/Permalinks.js +++ b/src/utils/permalinks/Permalinks.js @@ -294,13 +294,15 @@ export function isPermalinkHost(host: string): boolean { /** * Transforms a permalink (or possible permalink) into a local URL if possible. If * the given permalink is found to not be a permalink, it'll be returned unaltered. + * @param {string} permalink The permalink to try and transform. + * @returns {string} The transformed permalink or original URL if unable. */ export function tryTransformPermalinkToLocalHref(permalink: string): string { if (!permalink.startsWith("http:") && !permalink.startsWith("https:")) { return permalink; } - let m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); if (m) { return m[1]; } @@ -331,7 +333,7 @@ export function getPrimaryPermalinkEntity(permalink: string): string { // If not a permalink, try the vector patterns. if (!permalinkParts) { - let m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); + const m = permalink.match(matrixLinkify.VECTOR_URL_PATTERN); if (m) { // A bit of a hack, but it gets the job done const handler = new RiotPermalinkConstructor("http://localhost"); diff --git a/src/utils/permalinks/RiotPermalinkConstructor.js b/src/utils/permalinks/RiotPermalinkConstructor.js index f8c4cb361e..176100aa8b 100644 --- a/src/utils/permalinks/RiotPermalinkConstructor.js +++ b/src/utils/permalinks/RiotPermalinkConstructor.js @@ -20,7 +20,6 @@ import PermalinkConstructor, {PermalinkParts} from "./PermalinkConstructor"; * Generates permalinks that self-reference the running webapp */ export default class RiotPermalinkConstructor extends PermalinkConstructor { - _riotUrl: string; constructor(riotUrl: string) {