fix: make toHtml async
This commit is contained in:
parent
39a4eea08e
commit
9e309f740e
3 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ import { intersperse } from '@/prelude/array.js';
|
|||
// Transforms MFM to HTML, given the MFM text and a list of user IDs that are
|
||||
// mentioned in the text. If the list of mentions is not given, all mentions
|
||||
// from the text will be extracted.
|
||||
export function toHtml(mfmText: string, mentions?: string[]): string | null {
|
||||
export async function toHtml(mfmText: string, mentions?: string[]): string | null {
|
||||
const nodes = mfm.parse(mfmText);
|
||||
if (nodes == null) {
|
||||
return null;
|
||||
|
|
|
@ -100,7 +100,7 @@ export default async function renderNote(note: Note, dive = true, isTalk = false
|
|||
|
||||
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
|
||||
|
||||
const content = toHtml(apText, note.mentions);
|
||||
const content = await toHtml(apText, note.mentions);
|
||||
|
||||
const emojis = await getEmojis(note.emojis);
|
||||
const apemojis = emojis.map(emoji => renderEmoji(emoji));
|
||||
|
|
|
@ -65,7 +65,7 @@ export async function renderPerson(user: ILocalUser) {
|
|||
url: `${config.url}/@${user.username}`,
|
||||
preferredUsername: user.username,
|
||||
name: user.name,
|
||||
summary: profile.description ? toHtml(profile.description) : null,
|
||||
summary: profile.description ? await toHtml(profile.description) : null,
|
||||
icon: avatar ? renderImage(avatar) : null,
|
||||
image: banner ? renderImage(banner) : null,
|
||||
tag,
|
||||
|
|
Loading…
Reference in a new issue