1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Desktop: Fixed attachment markup when importing ENEX files as HTML so that it works in mobile too

This commit is contained in:
Laurent Cozic
2019-10-30 18:23:37 +00:00
parent d346cdb897
commit 273c0f432c

View File

@ -45,12 +45,9 @@ const attributesToStr = (attributes) =>
.map(([key, value]) => ` ${key}="${escapeQuotes(value)}"`) .map(([key, value]) => ` ${key}="${escapeQuotes(value)}"`)
.join(''); .join('');
const ipcProxySendToHost = (id) =>
`onclick="ipcProxySendToHost('joplin://${id}'); return false;"`;
const attachmentElement = ({src, attributes, id}) => const attachmentElement = ({src, attributes, id}) =>
[ [
`<a href='#' ${attributesToStr(attributes)} ${ipcProxySendToHost(id)}>`, `<a href='joplin://${id}' ${attributesToStr(attributes)}>`,
` ${attributes.alt || src}`, ` ${attributes.alt || src}`,
'</a>', '</a>',
].join(''); ].join('');
@ -67,7 +64,7 @@ const audioElement = ({src, alt, id}) =>
' </p>', ' </p>',
'</audio>', '</audio>',
'<p>', '<p>',
` <a href="${src}" ${ipcProxySendToHost(id)}>`, ` <a href="${src}">`,
` ${alt || src || id || 'Download audio'}`, ` ${alt || src || id || 'Download audio'}`,
' </a>', ' </a>',
'</p>', '</p>',