diff --git a/src/modules/codePreviews.js b/src/modules/codePreviews.js index 9442ce5..7ccca9c 100644 --- a/src/modules/codePreviews.js +++ b/src/modules/codePreviews.js @@ -39,7 +39,8 @@ async function processFile( const urlObj = new URL(link); let fileName = decodeURIComponent(urlObj.pathname).substring( - link.lastIndexOf("/") + 1 + urlObj.pathname.lastIndexOf("/") + 1, + urlObj.pathname.length ); const fileType = fileName.lastIndexOf(".") == -1