@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.
@@ -4547,6 +4547,16 @@ function createCache() {
4547
4547
  stylesWithHoverClass
4548
4548
  };
4549
4549
  }
4550
+ function safeDocNode(n2, options) {
4551
+ let stringContent = n2.textContent;
4552
+ if (n2.isStyle && options.hackCss) {
4553
+ try {
4554
+ stringContent = adaptCssForReplay(n2.textContent, options.cache);
4555
+ } catch (e2) {
4556
+ }
4557
+ }
4558
+ return options.doc.createTextNode(stringContent);
4559
+ }
4550
4560
  function buildNode(n2, options) {
4551
4561
  var _a2;
4552
4562
  const { doc, hackCss, cache } = options;
@@ -4695,9 +4705,11 @@ function buildNode(n2, options) {
4695
4705
  return node2;
4696
4706
  }
4697
4707
  case NodeType$1$1.Text:
4698
- return doc.createTextNode(
4699
- n2.isStyle && hackCss ? adaptCssForReplay(n2.textContent, cache) : n2.textContent
4700
- );
4708
+ return safeDocNode(n2, {
4709
+ cache,
4710
+ doc,
4711
+ hackCss
4712
+ });
4701
4713
  case NodeType$1$1.CDATA:
4702
4714
  if (n2.textContent.trim() === "") {
4703
4715
  return null;
@@ -11955,7 +11967,7 @@ class Replayer {
11955
11967
  this.virtualDom.mirror
11956
11968
  );
11957
11969
  } catch (e2) {
11958
- console.warn(e2);
11970
+ this.warn(e2);
11959
11971
  }
11960
11972
  this.virtualDom.destroyTree();
11961
11973
  this.usingVirtualDom = false;