summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/misc/get-note-html.ts
blob: a63059a38d37d2f1434dec356a693328d00cbd59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { INote } from "../../../models/note";
import toHtml from '../../../text/html';
import parse from '../../../text/parse';
import config from '../../../config';

export default function(note: INote) {
	if (note.text == null) return null;

	let html = toHtml(parse(note.text));

	if (note.poll != null) {
		const url = `${config.url}/notes/${note._id}`;
		// TODO: i18n
		html += `<p>【投票】<br />${url}</p>`;
	}

	return html;
}