summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-04-01 12:09:43 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-04-01 12:09:43 -0400
commit3034c94c242e4e2b037adcd6d74dff628176d251 (patch)
tree68c48c54fd742793d116961dea27ccd3d3df016b
parentdocs: add instructions for updating ci.yml (diff)
downloadsharkey-3034c94c242e4e2b037adcd6d74dff628176d251.tar.gz
sharkey-3034c94c242e4e2b037adcd6d74dff628176d251.tar.bz2
sharkey-3034c94c242e4e2b037adcd6d74dff628176d251.zip
copy changes from toHtml to toMastoApiHtml
-rw-r--r--packages/backend/src/core/MfmService.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/backend/src/core/MfmService.ts b/packages/backend/src/core/MfmService.ts
index 2ca024a4a0..9317da5b69 100644
--- a/packages/backend/src/core/MfmService.ts
+++ b/packages/backend/src/core/MfmService.ts
@@ -850,11 +850,14 @@ export class MfmService {
let result = new XMLSerializer().serializeToString(body);
+ // Remove the unnecessary namespace
+ result = result.replace(/^\s*<p xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">/, '<p>');
+
if (inline) {
result = result.replace(/^<p>/, '').replace(/<\/p>$/, '');
}
- happyDOM.close().catch(e => {});
+ happyDOM.close().catch(() => {});
return result;
}