fix(image): avoid prepending '/img/' to svg path

This commit is contained in:
curben 2020-02-15 21:32:47 +00:00
parent 1b77cdd383
commit 8a3c90641b
No known key found for this signature in database
GPG Key ID: 5D9DB57A25D34EE3
1 changed files with 2 additions and 0 deletions

View File

@ -11,6 +11,8 @@
hexo.extend.filter.register('marked:renderer', (renderer) => { hexo.extend.filter.register('marked:renderer', (renderer) => {
renderer.image = (href, title, alt) => { renderer.image = (href, title, alt) => {
if (href.endsWith('.svg')) return `<img src="${href}" alt="${alt}">`
if (!alt) alt = '' if (!alt) alt = ''
if (!title) title = alt if (!title) title = alt
let modern = href let modern = href