File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,9 @@ class Crawler {
120120 }
121121
122122 async getImage ( body ) {
123- const regex = / ! \[ [ ^ \] ] * \] \( ( .* ?.p n g | .* ?.j p e g | .* ?.j p g | .* ?.w e b p | .* ?.s v g | .* ?.g i f | .* ?.t i f f ) \s * ( " (?: .* [ ^ " ] ) " ) ? \s * \) | ! \[ [ ^ \] ] * \] \( ( .* ?) \s * ( " (?: .* [ ^ " ] ) " ) ? \s * \) / g;
123+ const regex = / ! \[ ( [ ^ \] ] * ) \] \( ( .* ?.p n g | .* ?.j p e g | .* ?.j p g | .* ?.w e b p | .* ?.s v g | .* ?.g i f | .* ?.t i f f ) \s * ( " (?: .* [ ^ " ] ) " ) ? \s * \) | ! \[ [ ^ \] ] * \] \( ( .* ?) \s * ( " (?: .* [ ^ " ] ) " ) ? \s * \) / g;
124124
125- body = body . replace ( regex , ( _ , url ) => {
125+ body = body . replace ( regex , ( _ , alt , url ) => {
126126 if ( ! url ) return ;
127127
128128 const filename = url . replace ( / \/ \s * $ / , '' ) . split ( '/' ) . slice ( - 2 ) . join ( '-' ) . trim ( ) ;
@@ -136,7 +136,7 @@ class Crawler {
136136 . then ( resp => resp . data . pipe ( fs . createWriteStream ( path ) ) )
137137 . catch ( e => console . error ( `⚠️ 이미지를 다운 받는데 오류가 발생했습니다 / url = ${ url } , e = ${ e } ` ) ) ;
138138
139- return `` ;
139+ return `` ;
140140 } ) ;
141141
142142 return body ;
You can’t perform that action at this time.
0 commit comments