@posthog/rrweb-player 0.0.20 → 0.0.22

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.
@@ -4517,6 +4517,16 @@ function createCache() {
4517
4517
  stylesWithHoverClass
4518
4518
  };
4519
4519
  }
4520
+ function safeDocNode(n2, options) {
4521
+ let stringContent = n2.textContent;
4522
+ if (n2.isStyle && options.hackCss) {
4523
+ try {
4524
+ stringContent = adaptCssForReplay(n2.textContent, options.cache);
4525
+ } catch {
4526
+ }
4527
+ }
4528
+ return options.doc.createTextNode(stringContent);
4529
+ }
4520
4530
  function buildNode(n2, options) {
4521
4531
  var _a2;
4522
4532
  const { doc, hackCss, cache } = options;
@@ -4665,9 +4675,11 @@ function buildNode(n2, options) {
4665
4675
  return node2;
4666
4676
  }
4667
4677
  case NodeType$1$1.Text:
4668
- return doc.createTextNode(
4669
- n2.isStyle && hackCss ? adaptCssForReplay(n2.textContent, cache) : n2.textContent
4670
- );
4678
+ return safeDocNode(n2, {
4679
+ cache,
4680
+ doc,
4681
+ hackCss
4682
+ });
4671
4683
  case NodeType$1$1.CDATA:
4672
4684
  if (n2.textContent.trim() === "") {
4673
4685
  return null;
@@ -11926,7 +11938,7 @@ class Replayer {
11926
11938
  this.virtualDom.mirror
11927
11939
  );
11928
11940
  } catch (e2) {
11929
- console.warn(e2);
11941
+ this.warn(e2);
11930
11942
  }
11931
11943
  this.virtualDom.destroyTree();
11932
11944
  this.usingVirtualDom = false;