7 lines
365 B
TypeScript
7 lines
365 B
TypeScript
/** References in the retained toolbox are internal Wiki media, displayed as derivatives. */
|
|
export function referencePreview(source:string){
|
|
const path=new URL(source,'http://wiki.internal').pathname;
|
|
if(!/^\/api\/media\/[0-9a-f-]{36}$/.test(path))throw Error('Invalid reference media');
|
|
return '/api/preview?'+new URLSearchParams({source:path,width:'960'});
|
|
}
|