misskey/src/remote/activitypub/misc/get-note-html.ts

11 lines
278 B
TypeScript
Raw Normal View History

2018-06-18 07:28:43 +02:00
import { INote } from '../../../models/note';
import toHtml from '../../../mfm/html';
import parse from '../../../mfm/parse';
2018-04-22 03:44:17 +02:00
export default function(note: INote) {
2018-06-17 08:58:23 +02:00
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
2018-09-08 19:59:14 +02:00
if (html == null) html = '';
2018-04-22 03:44:17 +02:00
return html;
}