Skip to content

Commit

Permalink
create paragraphs from multiline caption
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Nov 16, 2024
1 parent 6121b16 commit 87971fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Extensions/one_click_postage.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,14 @@ XKit.extensions.one_click_postage = new Object({

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

const content = caption
.split('\n')
.map((text) => text.trim())
.filter(Boolean)
.map((text) => ({ formatting: [], type: 'text', text }));

const requestBody = {
content: caption ? [{ formatting: [], type: 'text', text: caption }] : [],
content,
tags,
parent_post_id: post_id,
parent_tumblelog_uuid,
Expand Down

0 comments on commit 87971fa

Please sign in to comment.