Don't convert post content into html

This commit is contained in:
silverpill 2022-10-14 15:00:23 +00:00
parent 4ee4975172
commit 07326c3a8f
2 changed files with 5 additions and 3 deletions

View file

@ -157,6 +157,7 @@ export async function getPostContext(
export interface PostData {
content: string;
content_type: string;
in_reply_to_id: string | null;
visibility: string;
mentions: string[];
@ -172,6 +173,7 @@ export async function createPost(
// Convert to Mastodon API Status entity
const statusData = {
status: postData.content,
content_type: postData.content_type,
"media_ids[]": postData.attachments.map((attachment) => attachment.id),
in_reply_to_id: postData.in_reply_to_id,
visibility: postData.visibility,

View file

@ -244,10 +244,10 @@ function canPublish(): boolean {
return getCharacterCount() >= 0 && !isLoading
}
async function publish() {
const contentRendered = renderMarkdownLite(content)
async function publish(contentType = "text/markdown") {
const postData = {
content: contentRendered,
content: contentType === "text/markdown" ? content : renderMarkdownLite(content),
content_type: contentType,
in_reply_to_id: props.inReplyTo ? props.inReplyTo.id : null,
visibility: visibility,
mentions: [],