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 @@ -224,7 +224,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
224
224
content : content
225
225
} , auth ) ;
226
226
if ( result . code === WordPressClientReturnCode . OK ) {
227
- postParams . content = postParams . content . replace ( img . original , `` ) ;
227
+ if ( img . width && img . height ) {
228
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } x${ img . height } ]]` ) ;
229
+ } else if ( img . width ) {
230
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } ]]` ) ;
231
+ } else {
232
+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } ]]` ) ;
233
+ }
228
234
} else {
229
235
if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
230
236
new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -262,7 +268,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
262
268
// read note title, content and matter data
263
269
const title = file . basename ;
264
270
const { content, matter : matterData } = await processFile ( file , this . plugin . app ) ;
265
-
271
+
266
272
// check if profile selected is matched to the one in note property,
267
273
// if not, ask whether to update or not
268
274
await this . checkExistingProfile ( matterData ) ;
You can’t perform that action at this time.
0 commit comments