copy changes from toHtml to toMastoApiHtml

This commit is contained in:
Hazelnoot 2025-04-01 12:09:43 -04:00
parent 067d56ba03
commit 3034c94c24

View file

@ -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;
}