From fa912197141a7cbffd4cbef57971919da141d0f0 Mon Sep 17 00:00:00 2001 From: Cynthia Foxwell Date: Sat, 7 May 2022 17:06:31 -0600 Subject: [PATCH] codePreviews: fix line number regex --- src/modules/codePreviews.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/codePreviews.js b/src/modules/codePreviews.js index 448d5e4..1ac62ba 100644 --- a/src/modules/codePreviews.js +++ b/src/modules/codePreviews.js @@ -44,12 +44,12 @@ events.add("messageCreate", "codePreviews", async function (msg) { ? "" : fileName.substring(fileName.indexOf(".") + 1); - const lineStr = link.match(/#L\d+?(-L\d+?)?/)?.[0]; + const lineStr = link.match(/#L\d+(-L\d+)?/)?.[0]; let startLine, endLine; let entireFile = false; if (lineStr) { - let [start, end] = link.match(/L\d+?/g); + let [start, end] = link.match(/L\d+/g); start = parseInt(start.replace("L", "")); if (!end) { startLine = endLine = start;