Skip to content

Commit 87971fa

Browse files
committed
create paragraphs from multiline caption
1 parent 6121b16 commit 87971fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Extensions/one_click_postage.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,8 +1287,14 @@ XKit.extensions.one_click_postage = new Object({
12871287

12881288
const requestPath = `/v2/blog/${blog_id}/posts`;
12891289

1290+
const content = caption
1291+
.split('\n')
1292+
.map((text) => text.trim())
1293+
.filter(Boolean)
1294+
.map((text) => ({ formatting: [], type: 'text', text }));
1295+
12901296
const requestBody = {
1291-
content: caption ? [{ formatting: [], type: 'text', text: caption }] : [],
1297+
content,
12921298
tags,
12931299
parent_post_id: post_id,
12941300
parent_tumblelog_uuid,

0 commit comments

Comments
 (0)