Fix raw GitHub URL being output to content (#2147)
* fix thumbnail quality * Revert "fix(git-gateway): fix previews for GitHub images not in Large Media (#2125)" This reverts commit d17f896f479292db06d3a4b39f2e51b6c41101bd. * wip * Stop using thunks to load media display URLs * Revert changes to dev-test * Revert changes to large media docs * fix lint error * Update docs to point to the upcoming version with non-broken media
This commit is contained in:
committed by
Benaiah Mischenko
parent
40df666151
commit
37138834d6
@ -164,7 +164,7 @@ export default class GitHub {
|
||||
if (url.pathname.match(/.svg$/)) {
|
||||
url.search += (url.search.slice(1) === '' ? '?' : '&') + 'sanitize=true';
|
||||
}
|
||||
return { id: sha, name, size, url: url.href, urlIsPublicPath: true, path };
|
||||
return { id: sha, name, size, displayURL: url.href, path };
|
||||
}),
|
||||
);
|
||||
}
|
||||
@ -178,8 +178,14 @@ export default class GitHub {
|
||||
await this.api.persistFiles(null, [mediaFile], options);
|
||||
|
||||
const { sha, value, path, fileObj } = mediaFile;
|
||||
const url = URL.createObjectURL(fileObj);
|
||||
return { id: sha, name: value, size: fileObj.size, url, path: trimStart(path, '/') };
|
||||
const displayURL = URL.createObjectURL(fileObj);
|
||||
return {
|
||||
id: sha,
|
||||
name: value,
|
||||
size: fileObj.size,
|
||||
displayURL,
|
||||
path: trimStart(path, '/'),
|
||||
};
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw error;
|
||||
|
Reference in New Issue
Block a user