You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Server: Add support for sharing notes via a link
This commit is contained in:
@ -9,12 +9,17 @@ export interface Options {
|
||||
pdfViewerEnabled: boolean;
|
||||
}
|
||||
|
||||
function resourceUrl(resourceFullPath: string): string {
|
||||
if (resourceFullPath.indexOf('http://') === 0 || resourceFullPath.indexOf('https://')) return resourceFullPath;
|
||||
return `file://${toForwardSlashes(resourceFullPath)}`;
|
||||
}
|
||||
|
||||
export default function(link: Link, options: Options) {
|
||||
const resource = link.resource;
|
||||
|
||||
if (!link.resourceReady || !resource || !resource.mime) return '';
|
||||
|
||||
const escapedResourcePath = htmlentities(`file://${toForwardSlashes(link.resourceFullPath)}`);
|
||||
const escapedResourcePath = htmlentities(resourceUrl(link.resourceFullPath));
|
||||
const escapedMime = htmlentities(resource.mime);
|
||||
|
||||
if (options.videoPlayerEnabled && resource.mime.indexOf('video/') === 0) {
|
||||
|
Reference in New Issue
Block a user