File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,7 +224,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
224224 content : content
225225 } , auth ) ;
226226 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+ }
228234 } else {
229235 if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
230236 new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -262,7 +268,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
262268 // read note title, content and matter data
263269 const title = file . basename ;
264270 const { content, matter : matterData } = await processFile ( file , this . plugin . app ) ;
265-
271+
266272 // check if profile selected is matched to the one in note property,
267273 // if not, ask whether to update or not
268274 await this . checkExistingProfile ( matterData ) ;
You can’t perform that action at this time.
0 commit comments