File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,9 +135,10 @@ export abstract class AbstractWordPressClient implements WordPressClient {
135135 auth,
136136 postParams
137137 } ) ;
138+ const html = AppState . getInstance ( ) . markdownParser . render ( postParams . content ) ;
138139 const result = await this . publish (
139140 postParams . title ?? 'A post from Obsidian!' ,
140- AppState . getInstance ( ) . markdownParser . render ( postParams . content ) ?? '' ,
141+ html ,
141142 postParams ,
142143 auth ) ;
143144 if ( result . code === WordPressClientReturnCode . Error ) {
@@ -223,9 +224,7 @@ export abstract class AbstractWordPressClient implements WordPressClient {
223224 content : content
224225 } , auth ) ;
225226 if ( result . code === WordPressClientReturnCode . OK ) {
226- if ( this . plugin . settings . replaceMediaLinks ) {
227- postParams . content = postParams . content . replace ( img . original , `` ) ;
228- }
227+ postParams . content = postParams . content . replace ( img . original , `` ) ;
229228 } else {
230229 if ( result . error . code === WordPressClientReturnCode . ServerInternalError ) {
231230 new Notice ( result . error . message , ERROR_NOTICE_TIMEOUT ) ;
@@ -236,11 +235,13 @@ export abstract class AbstractWordPressClient implements WordPressClient {
236235 }
237236 }
238237 }
239- activeEditor . editor . setValue ( postParams . content ) ;
240238 } else {
241239 // src is a url, skip uploading
242240 }
243241 }
242+ if ( this . plugin . settings . replaceMediaLinks ) {
243+ activeEditor . editor . setValue ( postParams . content ) ;
244+ }
244245 }
245246 }
246247
You can’t perform that action at this time.
0 commit comments