mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 01:13:48 +01:00
Fix #2725
This commit is contained in:
parent
9580204ff1
commit
91ac4da813
@ -1,22 +1,10 @@
|
||||
import { INote } from '../../../models/note';
|
||||
import toHtml from '../../../mfm/html';
|
||||
import parse from '../../../mfm/parse';
|
||||
import config from '../../../config';
|
||||
|
||||
export default function(note: INote) {
|
||||
let html = toHtml(parse(note.text), note.mentionedRemoteUsers);
|
||||
if (html == null) html = '';
|
||||
|
||||
if (note.poll != null) {
|
||||
const url = `${config.url}/notes/${note._id}`;
|
||||
// TODO: i18n
|
||||
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>`;
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
|
@ -82,6 +82,20 @@ export default async function renderNote(note: INote, dive = true): Promise<any>
|
||||
|
||||
const files = await promisedFiles;
|
||||
|
||||
if (note.poll != null) {
|
||||
if (note.text == null) note.text = '';
|
||||
const url = `${config.url}/notes/${note._id}`;
|
||||
// TODO: i18n
|
||||
note.text += `\n\n[投票を見る](${url})`;
|
||||
}
|
||||
|
||||
if (note.renoteId != null) {
|
||||
if (note.text == null) note.text = '';
|
||||
const url = `${config.url}/notes/${note.renoteId}`;
|
||||
note.text += `\n\nRE: ${url}`;
|
||||
}
|
||||
|
||||
// 省略されたメンションのホストを復元する
|
||||
const text = note.text ? parseMfm(note.text).map(x => {
|
||||
if (x.type == 'mention' && x.host == null) {
|
||||
return `${x.content}@${config.host}`;
|
||||
|
Loading…
Reference in New Issue
Block a user