File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
212
212
content : content
213
213
} , auth ) ;
214
214
if ( result . code === WordPressClientReturnCode . OK ) {
215
- postParams . content = postParams . content . replace ( img . original , `` ) ;
215
+ if ( img . width && img . height ) {
216
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } x${ img . height } ]]` ) ;
217
+ } else if ( img . width ) {
218
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } ]]` ) ;
219
+ } else {
220
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } ]]` ) ;
221
+ }
216
222
} else {
217
223
if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
218
224
new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -250,7 +256,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
250
256
// read note title, content and matter data
251
257
const title = file . basename ;
252
258
const { content, matter : matterData } = await processFile ( file , this . plugin . app ) ;
253
-
259
+
254
260
// check if profile selected is matched to the one in note property,
255
261
// if not, ask whether to update or not
256
262
await this . checkExistingProfile ( matterData ) ;
You can’t perform that action at this time.
0 commit comments