Fix title being "null"
This commit is contained in:
parent
a6a50951ff
commit
adf35f2376
|
@ -223,13 +223,16 @@
|
||||||
marked.use({
|
marked.use({
|
||||||
renderer: {
|
renderer: {
|
||||||
image: (src, title, text) => {
|
image: (src, title, text) => {
|
||||||
|
|
||||||
|
title = title ? ` title="${title}` : ''
|
||||||
|
|
||||||
// If the url starts with the api url, the image is likely an attachment and
|
// If the url starts with the api url, the image is likely an attachment and
|
||||||
// we'll need to download and parse it properly.
|
// we'll need to download and parse it properly.
|
||||||
if (src.substr(0, window.API_URL.length + 7) === `${window.API_URL}/tasks/`) {
|
if (src.substr(0, window.API_URL.length + 7) === `${window.API_URL}/tasks/`) {
|
||||||
return `<img data-src="${src}" alt="${text}" title="${title}" class="attachment-image"/>`
|
return `<img data-src="${src}" alt="${text}" ${title} class="attachment-image"/>`
|
||||||
}
|
}
|
||||||
|
|
||||||
return `<img src="${src}" alt="${text}" title="${title}"/>`
|
return `<img src="${src}" alt="${text}" ${title}/>`
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Reference in New Issue
Block a user