File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ const extract = (options) => {
150
150
br : false ,
151
151
// 处理代码块
152
152
code : false ,
153
+ lazyKey : 'data-src' ,
153
154
selectors : {
154
155
title : '.article-title' ,
155
156
body : '.markdown-body' ,
@@ -198,7 +199,8 @@ const extract = (options) => {
198
199
const fileName = ( getText ( selectors . title ) || document . title )
199
200
const realName = fileName . replace ( / [ \\ \/ \? < > : ' \* \| ] / g, '_' )
200
201
const files = queryAll ( 'img' , markdownBody ) . map ( item => {
201
- const url = item . src . replace ( / \? $ / , '' )
202
+ const src = item . getAttribute ( options . lazyKey ) || item . src
203
+ const url = src . replace ( / \? $ / , '' )
202
204
const ext = getExt ( url )
203
205
const name = realName + '/' + md5 ( url ) + ( ext ? '.' + ext : '' )
204
206
item . src = './' + name
You can’t perform that action at this time.
0 commit comments