You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-27 23:28:38 +02:00
Chore: Apply eslint rules
This commit is contained in:
@ -22,11 +22,11 @@ function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
|
||||
if (result && resourceStatus !== 'ready') {
|
||||
const icon = utils.resourceStatusFile(resourceStatus);
|
||||
return '<a class="not-loaded-resource resource-status-' + resourceStatus + '" data-resource-id="' + resourceId + '">' + '<img src="data:image/svg+xml;utf8,' + htmlentities(icon) + '"/>';
|
||||
return `<a class="not-loaded-resource resource-status-${resourceStatus}" data-resource-id="${resourceId}">` + `<img src="data:image/svg+xml;utf8,${htmlentities(icon)}"/>`;
|
||||
} else {
|
||||
href = 'joplin://' + resourceId;
|
||||
if (resourceHrefInfo.hash) href += '#' + resourceHrefInfo.hash;
|
||||
resourceIdAttr = 'data-resource-id=\'' + resourceId + '\'';
|
||||
href = `joplin://${resourceId}`;
|
||||
if (resourceHrefInfo.hash) href += `#${resourceHrefInfo.hash}`;
|
||||
resourceIdAttr = `data-resource-id='${resourceId}'`;
|
||||
icon = '<span class="resource-icon"></span>';
|
||||
}
|
||||
} else {
|
||||
@ -35,9 +35,9 @@ function installRule(markdownIt, mdOptions, ruleOptions) {
|
||||
hrefAttr = href;
|
||||
}
|
||||
|
||||
let js = ruleOptions.postMessageSyntax + '(' + JSON.stringify(href) + '); return false;';
|
||||
let js = `${ruleOptions.postMessageSyntax}(${JSON.stringify(href)}); return false;`;
|
||||
if (hrefAttr.indexOf('#') === 0 && href.indexOf('#') === 0) js = ''; // If it's an internal anchor, don't add any JS since the webview is going to handle navigating to the right place
|
||||
return '<a data-from-md ' + resourceIdAttr + ' title=\'' + htmlentities(title) + '\' href=\'' + hrefAttr + '\' onclick=\'' + js + '\'>' + icon;
|
||||
return `<a data-from-md ${resourceIdAttr} title='${htmlentities(title)}' href='${hrefAttr}' onclick='${js}'>${icon}`;
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user