fix(render): image url
This commit is contained in:
parent
fa54b52048
commit
6f87529256
2 changed files with 6 additions and 1 deletions
|
|
@ -57,6 +57,12 @@ export function init () {
|
|||
}
|
||||
return `<p>${text}</p>`
|
||||
}
|
||||
renderer.image = function (href, title, text) {
|
||||
const url = /:/.test(href) ? href : ($docsify.basePath + href).replace(/\/+/g, '/')
|
||||
const titleHTML = title ? ` title="${title}"` : ''
|
||||
|
||||
return `<img src="${url}" alt="${text}"${titleHTML} />`
|
||||
}
|
||||
|
||||
if (typeof $docsify.markdown === 'function') {
|
||||
markdown.setOptions({ renderer })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue