Skip to content

Commit 28d3f07

Browse files
committed
Support new DropBox sharing url format #408
1 parent ee1e0fb commit 28d3f07

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

source/engine/io/fileutils.js

+2-10
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,12 @@ export function TransformFileHostUrls (urls)
103103
{
104104
for (let i = 0; i < urls.length; i++) {
105105
let url = urls[i];
106-
if (url.search (/www\.dropbox\.com/u) !== -1) {
106+
if (url.indexOf ('www.dropbox.com') !== -1) {
107107
url = url.replace ('www.dropbox.com', 'dl.dropbox.com');
108-
let separatorPos = url.indexOf ('?');
109-
if (separatorPos !== -1) {
110-
url = url.substring (0, separatorPos);
111-
}
112108
urls[i] = url;
113-
} else if (url.search (/github\.com/u) !== -1) {
109+
} else if (url.indexOf ('github.com') !== -1) {
114110
url = url.replace ('github.com', 'raw.githubusercontent.com');
115111
url = url.replace ('/blob', '');
116-
let separatorPos = url.indexOf ('?');
117-
if (separatorPos !== -1) {
118-
url = url.substring (0, separatorPos);
119-
}
120112
urls[i] = url;
121113
}
122114
}

0 commit comments

Comments
 (0)