1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +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)}"`)
.join('');
const ipcProxySendToHost = (id) =>
`onclick="ipcProxySendToHost('joplin://${id}'); return false;"`;
const attachmentElement = ({src, attributes, id}) =>
[
`<a href='#' ${attributesToStr(attributes)} ${ipcProxySendToHost(id)}>`,
`<a href='joplin://${id}' ${attributesToStr(attributes)}>`,
` ${attributes.alt || src}`,
'</a>',
].join('');
@ -67,7 +64,7 @@ const audioElement = ({src, alt, id}) =>
' </p>',
'</audio>',
'<p>',
` <a href="${src}" ${ipcProxySendToHost(id)}>`,
` <a href="${src}">`,
` ${alt || src || id || 'Download audio'}`,
' </a>',
'</p>',