Skip to content

Commit eaa18ed

Browse files
committed
Only use gist ID from URL up to any = or & symbols
Fixes #6
1 parent 12c10a2 commit eaa18ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
}
3535

3636
// 2. get gist id and file name
37+
// Strip anything after '=' or '&' from the first segment to extract clean gist ID
3738
query = query.split('/');
38-
var gistId = query[0];
39+
var gistId = query[0].split(/[=&]/)[0];
3940
var fileName = decodeURIComponent(query[1] || '');
4041

4142
// 3. write data to blank

0 commit comments

Comments
 (0)