Use mfm-js for MFM parsing (#7415)
* wip * Update mfm.ts * wip * update mfmjs * refactor * nanka * Update mfm.ts * Update to-html.ts * Update to-html.ts * wip * fix test * fix test
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { URL } from 'url';
|
||||
import * as mfm from 'mfm-js';
|
||||
import renderImage from './image';
|
||||
import renderKey from './key';
|
||||
import config from '@/config';
|
||||
import { ILocalUser } from '../../../models/entities/user';
|
||||
import { toHtml } from '../../../mfm/to-html';
|
||||
import { parse } from '../../../mfm/parse';
|
||||
import { getEmojis } from './note';
|
||||
import renderEmoji from './emoji';
|
||||
import { IIdentifier } from '../models/identifier';
|
||||
@@ -66,7 +66,7 @@ export async function renderPerson(user: ILocalUser) {
|
||||
url: `${config.url}/@${user.username}`,
|
||||
preferredUsername: user.username,
|
||||
name: user.name,
|
||||
summary: toHtml(parse(profile.description)),
|
||||
summary: profile.description ? toHtml(mfm.parse(profile.description)) : null,
|
||||
icon: avatar ? renderImage(avatar) : null,
|
||||
image: banner ? renderImage(banner) : null,
|
||||
tag,
|
||||
|
Reference in New Issue
Block a user