1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-28 21:48:26 +09:00
misskey/src/remote/activitypub/misc/get-note-html.ts

24 lines
607 B
TypeScript
Raw Normal View History

2018-04-22 10:44:17 +09:00
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
2018-05-07 16:31:33 +09:00
html += `<p><a href="${url}">【Misskeyで投票を見る】</a></p>`;
}
if (note.renoteId != null) {
const url = `${config.url}/notes/${note.renoteId}`;
html += `<p>RE: <a href="${url}">${url}</a></p>`;
2018-04-22 10:44:17 +09:00
}
return html;
}