summaryrefslogtreecommitdiff
path: root/packages/backend/src/core
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-04-02 09:47:49 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-04-02 09:47:49 -0400
commit9dffb13be799d41a01cb75432bfc3ce064df9747 (patch)
tree2bce36c773a667e854d7ff62698ed88e8fda861f /packages/backend/src/core
parentfix lint errors in SkRemoteFollowersWarning.vue and MkInfo.vue (diff)
downloadsharkey-9dffb13be799d41a01cb75432bfc3ce064df9747.tar.gz
sharkey-9dffb13be799d41a01cb75432bfc3ce064df9747.tar.bz2
sharkey-9dffb13be799d41a01cb75432bfc3ce064df9747.zip
fix test errors in MfmService.ts
Diffstat (limited to 'packages/backend/src/core')
-rw-r--r--packages/backend/src/core/MfmService.ts9
1 files changed, 3 insertions, 6 deletions
diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts
index 9317da5b69..e51341ba0a 100644
--- a/packages/backend/src/core/MfmService.ts
+++ b/packages/backend/src/core/MfmService.ts
@@ -6,7 +6,7 @@
import { URL } from 'node:url';
import { Inject, Injectable } from '@nestjs/common';
import * as parse5 from 'parse5';
-import { Window, XMLSerializer } from 'happy-dom';
+import { Window } from 'happy-dom';
import { DI } from '@/di-symbols.js';
import type { Config } from '@/config.js';
import { intersperse } from '@/misc/prelude/array.js';
@@ -577,7 +577,7 @@ export class MfmService {
appendChildren(nodes, body);
// Remove the unnecessary namespace
- const serialized = new XMLSerializer().serializeToString(body).replace(/^\s*<p xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">/, '<p>');
+ const serialized = body.outerHTML;
happyDOM.close().catch(err => {});
@@ -848,10 +848,7 @@ export class MfmService {
body.appendChild(quote);
}
- let result = new XMLSerializer().serializeToString(body);
-
- // Remove the unnecessary namespace
- result = result.replace(/^\s*<p xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">/, '<p>');
+ let result = body.outerHTML;
if (inline) {
result = result.replace(/^<p>/, '').replace(/<\/p>$/, '');