@prose-reader/core 1.139.0 → 1.140.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2921,6 +2921,18 @@
2921
2921
  this.removeIllegalOpts();
2922
2922
  }
2923
2923
  }
2924
+ static getTextArea() {
2925
+ if (!_CfiHandler.tempTextArea) {
2926
+ if (!_CfiHandler.tempDocument) {
2927
+ _CfiHandler.tempDocument = document.implementation.createHTMLDocument();
2928
+ }
2929
+ _CfiHandler.tempTextArea = _CfiHandler.tempDocument.createElement("textarea");
2930
+ }
2931
+ return _CfiHandler.tempTextArea;
2932
+ }
2933
+ destroy() {
2934
+ _CfiHandler.tempTextArea = null;
2935
+ }
2924
2936
  removeIllegalOpts(parts) {
2925
2937
  if (!parts) {
2926
2938
  if (this.from) {
@@ -2943,15 +2955,6 @@
2943
2955
  }
2944
2956
  }
2945
2957
  }
2946
- static getTextArea() {
2947
- if (!_CfiHandler.tempTextArea) {
2948
- if (!_CfiHandler.tempDocument) {
2949
- _CfiHandler.tempDocument = document.implementation.createHTMLDocument();
2950
- }
2951
- _CfiHandler.tempTextArea = _CfiHandler.tempDocument.createElement("textarea");
2952
- }
2953
- return _CfiHandler.tempTextArea;
2954
- }
2955
2958
  static generatePart(node, offset, extra) {
2956
2959
  let cfi = ``;
2957
2960
  let o;
@@ -3660,6 +3663,7 @@
3660
3663
  if (doc) {
3661
3664
  try {
3662
3665
  const { node, offset: resolvedOffset } = cfiHandler.resolve(doc, {});
3666
+ cfiHandler.destroy();
3663
3667
  return {
3664
3668
  node,
3665
3669
  offset: offset ?? resolvedOffset,