This commit is contained in:
mattyatea 2024-05-21 20:26:38 +09:00
parent 782ff23e9c
commit b21bd116de
4 changed files with 125 additions and 2373 deletions

View file

@ -179,6 +179,7 @@
"typescript": "5.4.5", "typescript": "5.4.5",
"ulid": "2.3.0", "ulid": "2.3.0",
"vary": "1.1.2", "vary": "1.1.2",
"w3c-xmlserializer": "^5.0.0",
"web-push": "3.6.7", "web-push": "3.6.7",
"ws": "8.17.0", "ws": "8.17.0",
"xev": "3.0.2" "xev": "3.0.2"
@ -225,6 +226,7 @@
"@types/tinycolor2": "1.4.6", "@types/tinycolor2": "1.4.6",
"@types/tmp": "0.2.6", "@types/tmp": "0.2.6",
"@types/vary": "1.1.3", "@types/vary": "1.1.3",
"@types/w3c-xmlserializer": "^2.0.4",
"@types/web-push": "3.6.3", "@types/web-push": "3.6.3",
"@types/ws": "8.5.10", "@types/ws": "8.5.10",
"@typescript-eslint/eslint-plugin": "7.7.1", "@typescript-eslint/eslint-plugin": "7.7.1",

View file

@ -6,7 +6,8 @@
import { URL } from 'node:url'; import { URL } from 'node:url';
import { Inject, Injectable } from '@nestjs/common'; import { Inject, Injectable } from '@nestjs/common';
import * as parse5 from 'parse5'; import * as parse5 from 'parse5';
import { Window, XMLSerializer } from 'happy-dom'; import { JSDOM } from 'jsdom';
import serialize from 'w3c-xmlserializer';
import { DI } from '@/di-symbols.js'; import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js'; import type { Config } from '@/config.js';
import { intersperse } from '@/misc/prelude/array.js'; import { intersperse } from '@/misc/prelude/array.js';
@ -243,7 +244,7 @@ export class MfmService {
return null; return null;
} }
const { window } = new Window(); const { window } = new JSDOM() as unknown as { window: Window };
const doc = window.document; const doc = window.document;
@ -461,6 +462,6 @@ export class MfmService {
appendChildren(nodes, body); appendChildren(nodes, body);
return new XMLSerializer().serializeToString(body); return serialize(body);
} }
} }

View file

@ -39,7 +39,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="alwaysShowPlayer">Youtube.comやnicovideo.jpのプレイヤーを全て開いた状態にする</MkSwitch> <MkSwitch v-model="alwaysShowPlayer">Youtube.comやnicovideo.jpのプレイヤーを全て開いた状態にする</MkSwitch>
<MkSwitch v-model="alwaysExpandTweet">Xのポストを常時表示させる</MkSwitch> <MkSwitch v-model="alwaysExpandTweet">Xのポストを常時表示させる</MkSwitch>
<MkSelect v-model="draftSavingBehavior"> <MkSelect v-model="draftSavingBehavior">
<template #label>{{ i18n.ts.draftSavingBehavior }}<span class="_beta">{{ i18n.ts.originalFeature }}</span></template> <template #label>{{ i18n.ts.draftSavingBehavior }}<span class="_beta">{{ i18n.ts.kakuregaFeature }}</span></template>
<option value="auto">{{ i18n.ts._draftSavingBehavior.auto }}</option> <option value="auto">{{ i18n.ts._draftSavingBehavior.auto }}</option>
<option value="manual">{{ i18n.ts._draftSavingBehavior.manual }}</option> <option value="manual">{{ i18n.ts._draftSavingBehavior.manual }}</option>
</MkSelect> </MkSelect>

File diff suppressed because it is too large Load diff