Add `DetachedWindowAPI.close` calls to `MfmService`
This commit is contained in:
parent
bc02b4ae1f
commit
ceaec33249
|
@ -245,7 +245,7 @@ export class MfmService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { window } = new Window();
|
const { happyDOM, window } = new Window();
|
||||||
|
|
||||||
const doc = window.document;
|
const doc = window.document;
|
||||||
|
|
||||||
|
@ -463,7 +463,11 @@ export class MfmService {
|
||||||
|
|
||||||
appendChildren(nodes, body);
|
appendChildren(nodes, body);
|
||||||
|
|
||||||
return new XMLSerializer().serializeToString(body);
|
const serialized = new XMLSerializer().serializeToString(body);
|
||||||
|
|
||||||
|
happyDOM.close().catch(e => {});
|
||||||
|
|
||||||
|
return serialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
// the toMastoApiHtml function was taken from Iceshrimp and written by zotan and modified by marie to work with the current MK version
|
// the toMastoApiHtml function was taken from Iceshrimp and written by zotan and modified by marie to work with the current MK version
|
||||||
|
@ -474,7 +478,7 @@ export class MfmService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { window } = new Window();
|
const { happyDOM, window } = new Window();
|
||||||
|
|
||||||
const doc = window.document;
|
const doc = window.document;
|
||||||
|
|
||||||
|
@ -681,6 +685,8 @@ export class MfmService {
|
||||||
result = result.replace(/^<p>/, '').replace(/<\/p>$/, '');
|
result = result.replace(/^<p>/, '').replace(/<\/p>$/, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
happyDOM.close().catch(e => {});
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue