Skip to content

Commit 5006bdc

Browse files
committed
Fixed WordPress images to use HTML, include if 1 or more.
1 parent c8c423b commit 5006bdc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/api/XMLRPCApi.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,13 @@ class XMLRPCApi {
183183
var params = []
184184
const featured_image_id = images.length > 0 ? images[ 0 ]?.upload_id : null
185185

186-
if (images.length > 1) {
187-
const image_markdown = images.map(image => `![${ image.alt_text ?? "" }](${ image.remote_url })`).join('\n')
188-
content = `${content}\n\n${image_markdown}`
186+
if (images.length > 0) {
187+
const image_html = images.map(image => `<img src="${ image.remote_url }" alt="${ image.alt_text ?? "" }">`).join(" ")
188+
content = `${content}\n\n${image_html}`
189189
}
190190

191+
console.log("XMLRPCApi:send_post content", content)
192+
191193
if (is_wordpress) {
192194
// special params if WordPress
193195
verb = "wp.newPost"

0 commit comments

Comments
 (0)