1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Desktop: Add support for media players (video, audio and PDF)

This commit is contained in:
Laurent Cozic
2020-12-09 21:30:51 +00:00
parent a3f8b9027c
commit 13dbeb4b36
14 changed files with 171 additions and 21 deletions

View File

@ -12,7 +12,7 @@ function plugin(markdownIt: any, ruleOptions: RuleOptions) {
const isResourceUrl = ruleOptions.resources && !!resourceHrefInfo;
const title = utils.getAttr(token.attrs, 'title', isResourceUrl ? '' : href);
return linkReplacement(href, {
const replacement = linkReplacement(href, {
title,
resources: ruleOptions.resources,
ResourceModel: ruleOptions.ResourceModel,
@ -21,6 +21,15 @@ function plugin(markdownIt: any, ruleOptions: RuleOptions) {
postMessageSyntax: ruleOptions.postMessageSyntax,
enableLongPress: ruleOptions.enableLongPress,
});
ruleOptions.context.currentLinks.push({
href: href,
resource: replacement.resource,
resourceReady: replacement.resourceReady,
resourceFullPath: replacement.resourceFullPath,
});
return replacement.html;
};
}