fix(backend): フィードのノートのMFMはHTMLにレンダーしてから返す (#14006)

* fix(backend): フィードのノートのMFMはHTMLにレンダーしてから返す (test wip)

* chore: beforeEachを使う?

* fix: プレーンテキストにフォールバックしてMFMが含まれていないか調べる方針を実装

* fix: application/jsonだとパースされるのでその作用をキャンセル

* build: fix lint error

* docs: update CHANGELOG.md

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
Kisaragi
2024-06-22 12:51:02 +09:00
committed by GitHub
parent ef205fb60e
commit ac12ab8629
4 changed files with 26 additions and 3 deletions

View File

@@ -153,6 +153,23 @@ describe('Webリソース', () => {
path: path('nonexisting'),
status: 404,
}));
describe(' has entry such ', () => {
beforeEach(() => {
post(alice, { text: "**a**" })
});
test('MFMを含まない。', async () => {
const content = await simpleGet(path(alice.username), "*/*", undefined, res => res.text());
const _body: unknown = content.body;
// JSONフィードのときは改めて文字列化する
const body: string = typeof (_body) === "object" ? JSON.stringify(_body) : _body as string;
if (body.includes("**a**")) {
throw new Error("MFM shouldn't be included");
}
});
})
});
describe.each([{ path: '/api/foo' }])('$path', ({ path }) => {