Don't convert post content into html
This commit is contained in:
parent
4ee4975172
commit
07326c3a8f
2 changed files with 5 additions and 3 deletions
|
@ -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,
|
||||
|
|
|
@ -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: [],
|
||||
|
|
Loading…
Reference in a new issue