File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -223,7 +223,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
223223 content : content
224224 } , auth ) ;
225225 if ( result . code === WordPressClientReturnCode . OK ) {
226- postParams . content = postParams . content . replace ( img . original , `` ) ;
226+ if ( img . width && img . height ) {
227+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } x${ img . height } ]]` ) ;
228+ } else if ( img . width ) {
229+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } |${ img . width } ]]` ) ;
230+ } else {
231+ postParams . content = postParams . content . replace ( img . original , `![[${ result . data . url } ]]` ) ;
232+ }
227233 } else {
228234 if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
229235 new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -261,7 +267,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
261267 // read note title, content and matter data
262268 const title = file . basename ;
263269 const { content, matter : matterData } = await processFile ( file , this . plugin . app ) ;
264-
270+
265271 // check if profile selected is matched to the one in note property,
266272 // if not, ask whether to update or not
267273 await this . checkExistingProfile ( matterData ) ;
You can’t perform that action at this time.
0 commit comments