perf: replace parse5
with ultrahtml
(#336)
This commit is contained in:
parent
04615e443e
commit
1c0f8b0147
8 changed files with 94 additions and 143 deletions
|
@ -40,9 +40,9 @@ export function getDefaultDraft(options: Partial<Draft['params'] & Omit<Draft, '
|
|||
}
|
||||
}
|
||||
|
||||
export function getDraftFromStatus(status: Status, text?: null | string): Draft {
|
||||
export async function getDraftFromStatus(status: Status, text?: null | string): Promise<Draft> {
|
||||
return getDefaultDraft({
|
||||
status: text || convertMastodonHTML(status.content),
|
||||
status: text || await convertMastodonHTML(status.content),
|
||||
mediaIds: status.mediaAttachments.map(att => att.id),
|
||||
visibility: status.visibility,
|
||||
attachments: status.mediaAttachments,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue