File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -212,7 +212,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
212212 content : content
213213 } , auth ) ;
214214 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+ }
216222 } else {
217223 if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
218224 new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -250,7 +256,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
250256 // read note title, content and matter data
251257 const title = file . basename ;
252258 const { content, matter : matterData } = await processFile ( file , this . plugin . app ) ;
253-
259+
254260 // check if profile selected is matched to the one in note property,
255261 // if not, ask whether to update or not
256262 await this . checkExistingProfile ( matterData ) ;
You can’t perform that action at this time.
0 commit comments