Images in Hexo

The Weird Way Hexo Does Images

First issue: image tags don’t work properly.

I found this issue on GitHub which highlights the problem with a workaround from 2016. And no resolution.

The Expected Input
1
2
3
{% img /assets/images/Work-in-Progress.svg 240 75 "Work in Progress" "Work in Progress" %}
The Code Output
1
2
3
4
5
6
7
8
9
[ '/assets/images/Work-in-Progress.svg',
'240', // Here I got another '', because I added a space between the two numbers...
'75',
'Work',
'in',
'Progress',
'Work',
'in',
'Progress' ]
The Workaround
1
2
3
4
5
{% img /assets/images/Work-in-Progress.svg 240 75 '"Work in Progress"' '"Work in Progress"' %}
// or
{% img /assets/images/Work-in-Progress.svg 240 75 "'Work in Progress'" "'Work in Progress'" %}
Share