codePreviews: use lastIndexOf for file type

This commit is contained in:
Cynthia Foxwell 2023-04-03 13:53:49 -06:00
parent 7abd01a125
commit 68ccd5ff98
1 changed files with 2 additions and 2 deletions

View File

@ -31,9 +31,9 @@ async function processFile(link) {
link.indexOf("#") == -1 ? link.length : link.indexOf("#")
);
const fileType =
fileName.indexOf(".") == -1
fileName.lastIndexOf(".") == -1
? ""
: fileName.substring(fileName.indexOf(".") + 1);
: fileName.substring(fileName.lastIndexOf(".") + 1);
const lineStr = link.match(/#L\d+(-L?\d+)?/)?.[0];
let startLine, endLine;