We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bfc037a commit dd0d22fCopy full SHA for dd0d22f
1 file changed
src/index.ts
@@ -19,8 +19,9 @@ import md2markup from './md2markup.js';
19
20
function getUrlExtension(url) {
21
let extension;
22
- if (url.split('.').length > 1) {
23
- extension = url.split(/[#?]/)[0].split('.').pop().trim();
+ const lastSegment = url.split('/').pop() || '';
+ if (lastSegment.split('.').length > 1) {
24
+ extension = lastSegment.split(/[#?]/)[0].split('.').pop().trim();
25
}
26
return extension;
27
0 commit comments